using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using RadicadeServer.DB; #nullable disable namespace RadicadeServer.Migrations { /// /// Who a room's join box is from. The box already travelled with RecNet's /// Gift.FromPlayerId, but no room could set it, so every join box arrived with a sender of /// zero and the client had no name to put on it. /// [DbContext(typeof(RecDBContext))] [Migration("20261015120000_AddRoomJoinGiftFromPlayerId")] public partial class AddRoomJoinGiftFromPlayerId : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.Sql(@" IF COL_LENGTH(N'dbo.Rooms', N'JoinGiftFromPlayerId') IS NULL ALTER TABLE [Rooms] ADD [JoinGiftFromPlayerId] bigint NOT NULL DEFAULT 0;"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.Sql(@" IF COL_LENGTH(N'dbo.Rooms', N'JoinGiftFromPlayerId') IS NOT NULL ALTER TABLE [Rooms] DROP COLUMN [JoinGiftFromPlayerId];"); } } }