TwilioSMSReceiver/TwilioSMSReceiver/Migrations/20211227015928_AddMMSData.cs

54 lines
1.8 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace TwilioSMSReceiver.Migrations
{
public partial class AddMMSData : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "MMSContentPath",
table: "SMSMessages");
migrationBuilder.CreateTable(
name: "MMSModel",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
SMSModelId = table.Column<int>(type: "INTEGER", nullable: false),
OriginalMMSData = table.Column<string>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_MMSModel", x => x.Id);
table.ForeignKey(
name: "FK_MMSModel_SMSMessages_SMSModelId",
column: x => x.SMSModelId,
principalTable: "SMSMessages",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_MMSModel_SMSModelId",
table: "MMSModel",
column: "SMSModelId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "MMSModel");
migrationBuilder.AddColumn<string>(
name: "MMSContentPath",
table: "SMSMessages",
type: "TEXT",
nullable: true);
}
}
}