using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace API.Data.Migrations { /// public partial class OnDeckRemoval : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( name: "Title", table: "ReadingList", type: "TEXT", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "TEXT", oldNullable: true); migrationBuilder.AlterColumn( name: "NormalizedTitle", table: "ReadingList", type: "TEXT", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "TEXT", oldNullable: true); migrationBuilder.CreateTable( name: "AppUserOnDeckRemoval", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), SeriesId = table.Column(type: "INTEGER", nullable: false), AppUserId = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_AppUserOnDeckRemoval", x => x.Id); table.ForeignKey( name: "FK_AppUserOnDeckRemoval_AspNetUsers_AppUserId", column: x => x.AppUserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_AppUserOnDeckRemoval_Series_SeriesId", column: x => x.SeriesId, principalTable: "Series", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_AppUserOnDeckRemoval_AppUserId", table: "AppUserOnDeckRemoval", column: "AppUserId"); migrationBuilder.CreateIndex( name: "IX_AppUserOnDeckRemoval_SeriesId", table: "AppUserOnDeckRemoval", column: "SeriesId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "AppUserOnDeckRemoval"); migrationBuilder.AlterColumn( name: "Title", table: "ReadingList", type: "TEXT", nullable: true, oldClrType: typeof(string), oldType: "TEXT"); migrationBuilder.AlterColumn( name: "NormalizedTitle", table: "ReadingList", type: "TEXT", nullable: true, oldClrType: typeof(string), oldType: "TEXT"); } } }