SCHALE.GameServer/SCHALE.Common/Migrations/SqlServerMigrations/20241229024747_Currency_Rai...

250 lines
12 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SCHALE.Common.Migrations.SqlServerMigrations
{
/// <inheritdoc />
public partial class Currency_Raid_Dungeons_and_Campaign : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "CampaignStageHistories",
columns: table => new
{
ServerId = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
AccountServerId = table.Column<long>(type: "bigint", nullable: false),
StoryUniqueId = table.Column<long>(type: "bigint", nullable: false),
ChapterUniqueId = table.Column<long>(type: "bigint", nullable: false),
StageUniqueId = table.Column<long>(type: "bigint", nullable: false),
TacticClearCountWithRankSRecord = table.Column<long>(type: "bigint", nullable: false),
ClearTurnRecord = table.Column<long>(type: "bigint", nullable: false),
Star1Flag = table.Column<bool>(type: "bit", nullable: false),
Star2Flag = table.Column<bool>(type: "bit", nullable: false),
Star3Flag = table.Column<bool>(type: "bit", nullable: false),
LastPlay = table.Column<DateTime>(type: "datetime2", nullable: false),
TodayPlayCount = table.Column<long>(type: "bigint", nullable: false),
TodayPurchasePlayCountHardStage = table.Column<long>(type: "bigint", nullable: false),
FirstClearRewardReceive = table.Column<DateTime>(type: "datetime2", nullable: true),
StarRewardReceive = table.Column<DateTime>(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<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
AccountServerId = table.Column<long>(type: "bigint", nullable: false),
AccountLevel = table.Column<long>(type: "bigint", nullable: false),
AcademyLocationRankSum = table.Column<long>(type: "bigint", nullable: false),
CurrencyDict = table.Column<string>(type: "nvarchar(max)", nullable: false),
UpdateTimeDict = table.Column<string>(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<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
AccountServerId = table.Column<long>(type: "bigint", nullable: false),
Type = table.Column<int>(type: "int", nullable: false),
UniqueId = table.Column<long>(type: "bigint", nullable: false),
Sender = table.Column<string>(type: "nvarchar(max)", nullable: false),
Comment = table.Column<string>(type: "nvarchar(max)", nullable: false),
SendDate = table.Column<DateTime>(type: "datetime2", nullable: false),
ReceiptDate = table.Column<DateTime>(type: "datetime2", nullable: true),
ExpireDate = table.Column<DateTime>(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<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
AccountServerId = table.Column<long>(type: "bigint", nullable: false),
SeasonId = table.Column<long>(type: "bigint", nullable: false),
ClearedDifficulty = table.Column<int>(type: "int", nullable: false),
LastClearDate = table.Column<DateTime>(type: "datetime2", nullable: false),
RewardDifficulty = table.Column<int>(type: "int", nullable: false),
LastRewardDate = table.Column<DateTime>(type: "datetime2", nullable: false),
ClearBattleFrame = table.Column<int>(type: "int", nullable: false),
TotalReceivableRewards = table.Column<string>(type: "nvarchar(max)", nullable: false),
TotalReceivedRewards = table.Column<string>(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<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
AccountServerId = table.Column<long>(type: "bigint", nullable: false),
ScenarioGroupUqniueId = table.Column<long>(type: "bigint", nullable: false),
ScenarioType = table.Column<long>(type: "bigint", nullable: false),
EventContentId = table.Column<long>(type: "bigint", nullable: true),
ClearDateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
IsReturn = table.Column<bool>(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<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
AccountServerId = table.Column<long>(type: "bigint", nullable: false),
StageUniqueId = table.Column<long>(type: "bigint", nullable: false),
StarFlags = table.Column<string>(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<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
AccountServerId = table.Column<long>(type: "bigint", nullable: false),
StageUniqueId = table.Column<long>(type: "bigint", nullable: false),
StarGoalRecord = table.Column<string>(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");
}
/// <inheritdoc />
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");
}
}
}