using Microsoft.EntityFrameworkCore.Migrations; namespace StudyLib.Migrations { public partial class SubjectDeleteRequests : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "SubjectDeleteRequests", columns: table => new { ID = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), SubjectId = table.Column(type: "bigint", nullable: false) }, constraints: table => { table.PrimaryKey("PK_SubjectDeleteRequests", x => x.ID); table.ForeignKey( name: "FK_SubjectDeleteRequests_Subjects_SubjectId", column: x => x.SubjectId, principalTable: "Subjects", principalColumn: "ID", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_SubjectDeleteRequests_SubjectId", table: "SubjectDeleteRequests", column: "SubjectId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "SubjectDeleteRequests"); } } }