using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Data.Migrations { /// public partial class AddStudentEventRanking : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "StudentEventRanking", columns: table => new { EventDefinitionId = table.Column(type: "INTEGER", nullable: false), StudentId = table.Column(type: "INTEGER", nullable: false), Rank = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_StudentEventRanking", x => new { x.EventDefinitionId, x.StudentId }); table.ForeignKey( name: "FK_StudentEventRanking_Events_EventDefinitionId", column: x => x.EventDefinitionId, principalTable: "Events", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_StudentEventRanking_Students_StudentId", column: x => x.StudentId, principalTable: "Students", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_StudentEventRanking_StudentId", table: "StudentEventRanking", column: "StudentId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "StudentEventRanking"); } } }