using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace LANCommander.Migrations { /// public partial class AddGameRedistributableRelationship : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "GameRedistributable", columns: table => new { GameId = table.Column(type: "TEXT", nullable: false), RedistributableId = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_GameRedistributable", x => new { x.GameId, x.RedistributableId }); table.ForeignKey( name: "FK_GameRedistributable_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_GameRedistributable_Redistributables_RedistributableId", column: x => x.RedistributableId, principalTable: "Redistributables", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_GameRedistributable_RedistributableId", table: "GameRedistributable", column: "RedistributableId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "GameRedistributable"); } } }