using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace SCHALE.Common.Migrations.SqlServerMigrations { /// public partial class Currency_Raid_Dungeons_and_Campaign : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "CampaignStageHistories", columns: table => new { ServerId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), AccountServerId = table.Column(type: "bigint", nullable: false), StoryUniqueId = table.Column(type: "bigint", nullable: false), ChapterUniqueId = table.Column(type: "bigint", nullable: false), StageUniqueId = table.Column(type: "bigint", nullable: false), TacticClearCountWithRankSRecord = table.Column(type: "bigint", nullable: false), ClearTurnRecord = table.Column(type: "bigint", nullable: false), Star1Flag = table.Column(type: "bit", nullable: false), Star2Flag = table.Column(type: "bit", nullable: false), Star3Flag = table.Column(type: "bit", nullable: false), LastPlay = table.Column(type: "datetime2", nullable: false), TodayPlayCount = table.Column(type: "bigint", nullable: false), TodayPurchasePlayCountHardStage = table.Column(type: "bigint", nullable: false), FirstClearRewardReceive = table.Column(type: "datetime2", nullable: true), StarRewardReceive = table.Column(type: "datetime2", nullable: true) }, constraints: table => { table.PrimaryKey("PK_CampaignStageHistories", x => x.ServerId); table.ForeignKey( name: "FK_CampaignStageHistories_Accounts_AccountServerId", column: x => x.AccountServerId, principalTable: "Accounts", principalColumn: "ServerId", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Currencies", columns: table => new { ServerId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), AccountServerId = table.Column(type: "bigint", nullable: false), AccountLevel = table.Column(type: "bigint", nullable: false), AcademyLocationRankSum = table.Column(type: "bigint", nullable: false), CurrencyDict = table.Column(type: "nvarchar(max)", nullable: false), UpdateTimeDict = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Currencies", x => x.ServerId); table.ForeignKey( name: "FK_Currencies_Accounts_AccountServerId", column: x => x.AccountServerId, principalTable: "Accounts", principalColumn: "ServerId", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Mails", columns: table => new { ServerId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), AccountServerId = table.Column(type: "bigint", nullable: false), Type = table.Column(type: "int", nullable: false), UniqueId = table.Column(type: "bigint", nullable: false), Sender = table.Column(type: "nvarchar(max)", nullable: false), Comment = table.Column(type: "nvarchar(max)", nullable: false), SendDate = table.Column(type: "datetime2", nullable: false), ReceiptDate = table.Column(type: "datetime2", nullable: true), ExpireDate = table.Column(type: "datetime2", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Mails", x => x.ServerId); table.ForeignKey( name: "FK_Mails_Accounts_AccountServerId", column: x => x.AccountServerId, principalTable: "Accounts", principalColumn: "ServerId", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "MultiFloorRaids", columns: table => new { ServerId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), AccountServerId = table.Column(type: "bigint", nullable: false), SeasonId = table.Column(type: "bigint", nullable: false), ClearedDifficulty = table.Column(type: "int", nullable: false), LastClearDate = table.Column(type: "datetime2", nullable: false), RewardDifficulty = table.Column(type: "int", nullable: false), LastRewardDate = table.Column(type: "datetime2", nullable: false), ClearBattleFrame = table.Column(type: "int", nullable: false), TotalReceivableRewards = table.Column(type: "nvarchar(max)", nullable: false), TotalReceivedRewards = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_MultiFloorRaids", x => x.ServerId); table.ForeignKey( name: "FK_MultiFloorRaids_Accounts_AccountServerId", column: x => x.AccountServerId, principalTable: "Accounts", principalColumn: "ServerId", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "ScenarioGroupHistoryDB", columns: table => new { ServerId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), AccountServerId = table.Column(type: "bigint", nullable: false), ScenarioGroupUqniueId = table.Column(type: "bigint", nullable: false), ScenarioType = table.Column(type: "bigint", nullable: false), EventContentId = table.Column(type: "bigint", nullable: true), ClearDateTime = table.Column(type: "datetime2", nullable: false), IsReturn = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ScenarioGroupHistoryDB", x => x.ServerId); table.ForeignKey( name: "FK_ScenarioGroupHistoryDB_Accounts_AccountServerId", column: x => x.AccountServerId, principalTable: "Accounts", principalColumn: "ServerId", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "SchoolDungeonStageHistories", columns: table => new { ServerId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), AccountServerId = table.Column(type: "bigint", nullable: false), StageUniqueId = table.Column(type: "bigint", nullable: false), StarFlags = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_SchoolDungeonStageHistories", x => x.ServerId); table.ForeignKey( name: "FK_SchoolDungeonStageHistories_Accounts_AccountServerId", column: x => x.AccountServerId, principalTable: "Accounts", principalColumn: "ServerId", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "WeekDungeonStageHistories", columns: table => new { ServerId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), AccountServerId = table.Column(type: "bigint", nullable: false), StageUniqueId = table.Column(type: "bigint", nullable: false), StarGoalRecord = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_WeekDungeonStageHistories", x => x.ServerId); table.ForeignKey( name: "FK_WeekDungeonStageHistories_Accounts_AccountServerId", column: x => x.AccountServerId, principalTable: "Accounts", principalColumn: "ServerId", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_CampaignStageHistories_AccountServerId", table: "CampaignStageHistories", column: "AccountServerId"); migrationBuilder.CreateIndex( name: "IX_Currencies_AccountServerId", table: "Currencies", column: "AccountServerId"); migrationBuilder.CreateIndex( name: "IX_Mails_AccountServerId", table: "Mails", column: "AccountServerId"); migrationBuilder.CreateIndex( name: "IX_MultiFloorRaids_AccountServerId", table: "MultiFloorRaids", column: "AccountServerId"); migrationBuilder.CreateIndex( name: "IX_ScenarioGroupHistoryDB_AccountServerId", table: "ScenarioGroupHistoryDB", column: "AccountServerId"); migrationBuilder.CreateIndex( name: "IX_SchoolDungeonStageHistories_AccountServerId", table: "SchoolDungeonStageHistories", column: "AccountServerId"); migrationBuilder.CreateIndex( name: "IX_WeekDungeonStageHistories_AccountServerId", table: "WeekDungeonStageHistories", column: "AccountServerId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "CampaignStageHistories"); migrationBuilder.DropTable( name: "Currencies"); migrationBuilder.DropTable( name: "Mails"); migrationBuilder.DropTable( name: "MultiFloorRaids"); migrationBuilder.DropTable( name: "ScenarioGroupHistoryDB"); migrationBuilder.DropTable( name: "SchoolDungeonStageHistories"); migrationBuilder.DropTable( name: "WeekDungeonStageHistories"); } } }