using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace SlipItIn.Server.Migrations { /// public partial class UpdateGameRules : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( name: "TargetCardId", table: "SlipChallenges", type: "integer", nullable: true, oldClrType: typeof(int), oldType: "integer"); migrationBuilder.AddColumn( name: "SlippedAt", table: "PlayerCards", type: "timestamp with time zone", nullable: true); migrationBuilder.AddColumn( name: "WinnerPlayerId", table: "Games", type: "integer", nullable: true); migrationBuilder.CreateIndex( name: "IX_Games_WinnerPlayerId", table: "Games", column: "WinnerPlayerId"); migrationBuilder.AddForeignKey( name: "FK_Games_Players_WinnerPlayerId", table: "Games", column: "WinnerPlayerId", principalTable: "Players", principalColumn: "Id", onDelete: ReferentialAction.Restrict); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Games_Players_WinnerPlayerId", table: "Games"); migrationBuilder.DropIndex( name: "IX_Games_WinnerPlayerId", table: "Games"); migrationBuilder.DropColumn( name: "SlippedAt", table: "PlayerCards"); migrationBuilder.DropColumn( name: "WinnerPlayerId", table: "Games"); migrationBuilder.AlterColumn( name: "TargetCardId", table: "SlipChallenges", type: "integer", nullable: false, defaultValue: 0, oldClrType: typeof(int), oldType: "integer", oldNullable: true); } } }