Seeding reorg

This commit is contained in:
gamer147
2026-05-24 21:13:15 -04:00
parent 34bcc579a5
commit c14408ba06
73 changed files with 4611 additions and 369716 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,489 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SVSim.Database.Migrations
{
/// <inheritdoc />
public partial class ProdContentTables : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "CardSetIdForResourceDlView",
table: "GameConfigurations",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<long>(
name: "ChallengeTwoPickSleeveId",
table: "GameConfigurations",
type: "bigint",
nullable: false,
defaultValue: 0L);
migrationBuilder.AddColumn<bool>(
name: "ChallengeUseTwoPickPremiumCard",
table: "GameConfigurations",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsBattlePassPeriod",
table: "GameConfigurations",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsBeginnerMission",
table: "GameConfigurations",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "TsRotationId",
table: "GameConfigurations",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.CreateTable(
name: "ArenaSeasons",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
Mode = table.Column<int>(type: "integer", nullable: false),
Enable = table.Column<int>(type: "integer", nullable: false),
Cost = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
RupyCost = table.Column<decimal>(type: "numeric(20,0)", nullable: false),
TicketCost = table.Column<int>(type: "integer", nullable: false),
IsJoin = table.Column<bool>(type: "boolean", nullable: false),
FormatInfo = table.Column<string>(type: "jsonb", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ArenaSeasons", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AvatarAbilities",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
LeaderSkinId = table.Column<int>(type: "integer", nullable: false),
BattleStartFirstPlayerTurnBp = table.Column<int>(type: "integer", nullable: false),
BattleStartSecondPlayerTurnBp = table.Column<int>(type: "integer", nullable: false),
BattleStartMaxLife = table.Column<int>(type: "integer", nullable: false),
AbilityCost = table.Column<string>(type: "text", nullable: false),
Ability = table.Column<string>(type: "text", nullable: false),
PassiveAbility = table.Column<string>(type: "text", nullable: false),
AbilityDesc = table.Column<string>(type: "text", nullable: false),
PassiveAbilityDesc = table.Column<string>(type: "text", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AvatarAbilities", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Banners",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
ImageName = table.Column<string>(type: "text", nullable: false),
Click = table.Column<string>(type: "text", nullable: false),
Status = table.Column<string>(type: "text", nullable: false),
ChangeTime = table.Column<int>(type: "integer", nullable: false),
RemainingTime = table.Column<int>(type: "integer", nullable: false),
ImagePaths = table.Column<string>(type: "jsonb", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Banners", x => x.Id);
});
migrationBuilder.CreateTable(
name: "BattlePassLevels",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
Level = table.Column<int>(type: "integer", nullable: false),
RewardData = table.Column<string>(type: "jsonb", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_BattlePassLevels", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Colosseums",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
ColosseumId = table.Column<string>(type: "text", nullable: false),
ColosseumName = table.Column<string>(type: "text", nullable: false),
CardPoolName = table.Column<string>(type: "text", nullable: false),
DeckFormat = table.Column<string>(type: "text", nullable: false),
StartTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
EndTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
NowRound = table.Column<string>(type: "text", nullable: false),
IsDisplayTips = table.Column<string>(type: "text", nullable: false),
TipsId = table.Column<string>(type: "text", nullable: false),
IsColosseumPeriod = table.Column<bool>(type: "boolean", nullable: false),
IsRoundPeriod = table.Column<bool>(type: "boolean", nullable: false),
IsNormalTwoPick = table.Column<string>(type: "text", nullable: false),
IsSpecialMode = table.Column<string>(type: "text", nullable: false),
IsAllCardEnabled = table.Column<int>(type: "integer", nullable: false),
SalesPeriodInfo = table.Column<string>(type: "jsonb", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Colosseums", x => x.Id);
});
migrationBuilder.CreateTable(
name: "DailyLoginBonuses",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
BonusId = table.Column<int>(type: "integer", nullable: false),
BonusData = table.Column<string>(type: "jsonb", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DailyLoginBonuses", x => x.Id);
});
migrationBuilder.CreateTable(
name: "DefaultDecks",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
DeckNo = table.Column<int>(type: "integer", nullable: false),
ClassId = table.Column<int>(type: "integer", nullable: false),
SleeveId = table.Column<long>(type: "bigint", nullable: false),
LeaderSkinId = table.Column<int>(type: "integer", nullable: false),
DeckName = table.Column<string>(type: "text", nullable: false),
CardIdArray = table.Column<string>(type: "jsonb", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DefaultDecks", x => x.Id);
});
migrationBuilder.CreateTable(
name: "DefaultLeaderSkinSettings",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
ClassId = table.Column<int>(type: "integer", nullable: false),
IsRandomLeaderSkin = table.Column<int>(type: "integer", nullable: false),
LeaderSkinId = table.Column<int>(type: "integer", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DefaultLeaderSkinSettings", x => x.Id);
});
migrationBuilder.CreateTable(
name: "FeatureMaintenances",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
FeatureKey = table.Column<string>(type: "text", nullable: false),
Data = table.Column<string>(type: "jsonb", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FeatureMaintenances", x => x.Id);
});
migrationBuilder.CreateTable(
name: "LoadingExclusionCards",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false),
CardId = table.Column<long>(type: "bigint", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_LoadingExclusionCards", x => x.Id);
});
migrationBuilder.CreateTable(
name: "MaintenanceCards",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false),
CardId = table.Column<long>(type: "bigint", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_MaintenanceCards", x => x.Id);
});
migrationBuilder.CreateTable(
name: "MasterPointRankingPeriods",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
PeriodNum = table.Column<int>(type: "integer", nullable: false),
NecessaryScore = table.Column<long>(type: "bigint", nullable: false),
BeginTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
EndTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_MasterPointRankingPeriods", x => x.Id);
});
migrationBuilder.CreateTable(
name: "MyRotationAbilities",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
AbilityId = table.Column<int>(type: "integer", nullable: false),
Data = table.Column<string>(type: "jsonb", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_MyRotationAbilities", x => x.Id);
});
migrationBuilder.CreateTable(
name: "MyRotationSettings",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
RotationId = table.Column<int>(type: "integer", nullable: false),
CardSetIdsCsv = table.Column<string>(type: "text", nullable: false),
AbilitiesCsv = table.Column<string>(type: "text", nullable: false),
ReprintedCardIds = table.Column<string>(type: "jsonb", nullable: false),
RestrictedCardIds = table.Column<string>(type: "jsonb", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_MyRotationSettings", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PreReleaseInfos",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
PreReleaseId = table.Column<string>(type: "text", nullable: false),
NextCardSetId = table.Column<string>(type: "text", nullable: false),
StartTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
EndTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DisplayEndTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
FreeMatchStartTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CardMasterId = table.Column<int>(type: "integer", nullable: false),
DefaultCardMasterId = table.Column<string>(type: "text", nullable: false),
PreReleaseCardMasterId = table.Column<string>(type: "text", nullable: false),
IsPreRotationFreeMatchTerm = table.Column<bool>(type: "boolean", nullable: false),
RotationCardSetIdList = table.Column<string>(type: "jsonb", nullable: false),
ReprintedBaseCardIds = table.Column<string>(type: "jsonb", nullable: false),
LatestReprintedBaseCardIds = table.Column<string>(type: "jsonb", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PreReleaseInfos", x => x.Id);
});
migrationBuilder.CreateTable(
name: "ReprintedCards",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false),
CardId = table.Column<long>(type: "bigint", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ReprintedCards", x => x.Id);
});
migrationBuilder.CreateTable(
name: "SealedSeasons",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
Enable = table.Column<int>(type: "integer", nullable: false),
CrystalCost = table.Column<int>(type: "integer", nullable: false),
RupyCost = table.Column<int>(type: "integer", nullable: false),
TicketCost = table.Column<int>(type: "integer", nullable: false),
DeckUsingNumMin = table.Column<int>(type: "integer", nullable: false),
ScheduleId = table.Column<int>(type: "integer", nullable: false),
IsJoin = table.Column<bool>(type: "boolean", nullable: false),
IsDeckCodeMaintenance = table.Column<bool>(type: "boolean", nullable: false),
PackInfo = table.Column<string>(type: "jsonb", nullable: false),
SalesPeriodInfo = table.Column<string>(type: "jsonb", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_SealedSeasons", x => x.Id);
});
migrationBuilder.CreateTable(
name: "SpotCards",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false),
CardId = table.Column<long>(type: "bigint", nullable: false),
Cost = table.Column<int>(type: "integer", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_SpotCards", x => x.Id);
});
migrationBuilder.CreateTable(
name: "UnlimitedRestrictions",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false),
CardId = table.Column<long>(type: "bigint", nullable: false),
RestrictionValue = table.Column<int>(type: "integer", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_UnlimitedRestrictions", x => x.Id);
});
migrationBuilder.UpdateData(
table: "GameConfigurations",
keyColumn: "Id",
keyValue: "default",
columns: new[] { "CardSetIdForResourceDlView", "ChallengeTwoPickSleeveId", "ChallengeUseTwoPickPremiumCard", "IsBattlePassPeriod", "IsBeginnerMission", "TsRotationId" },
values: new object[] { 0, 0L, false, false, false, "" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ArenaSeasons");
migrationBuilder.DropTable(
name: "AvatarAbilities");
migrationBuilder.DropTable(
name: "Banners");
migrationBuilder.DropTable(
name: "BattlePassLevels");
migrationBuilder.DropTable(
name: "Colosseums");
migrationBuilder.DropTable(
name: "DailyLoginBonuses");
migrationBuilder.DropTable(
name: "DefaultDecks");
migrationBuilder.DropTable(
name: "DefaultLeaderSkinSettings");
migrationBuilder.DropTable(
name: "FeatureMaintenances");
migrationBuilder.DropTable(
name: "LoadingExclusionCards");
migrationBuilder.DropTable(
name: "MaintenanceCards");
migrationBuilder.DropTable(
name: "MasterPointRankingPeriods");
migrationBuilder.DropTable(
name: "MyRotationAbilities");
migrationBuilder.DropTable(
name: "MyRotationSettings");
migrationBuilder.DropTable(
name: "PreReleaseInfos");
migrationBuilder.DropTable(
name: "ReprintedCards");
migrationBuilder.DropTable(
name: "SealedSeasons");
migrationBuilder.DropTable(
name: "SpotCards");
migrationBuilder.DropTable(
name: "UnlimitedRestrictions");
migrationBuilder.DropColumn(
name: "CardSetIdForResourceDlView",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "ChallengeTwoPickSleeveId",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "ChallengeUseTwoPickPremiumCard",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "IsBattlePassPeriod",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "IsBeginnerMission",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "TsRotationId",
table: "GameConfigurations");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,37 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SVSim.Database.Migrations
{
/// <inheritdoc />
public partial class MypageRoomTypeInSession : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "SpecialDeckFormats",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
DeckFormat = table.Column<string>(type: "text", nullable: false),
EndTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_SpecialDeckFormats", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "SpecialDeckFormats");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,50 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SVSim.Database.Migrations
{
/// <inheritdoc />
public partial class MypagePaymentItems : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "PaymentItems",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
ProductId = table.Column<int>(type: "integer", nullable: false),
StoreProductId = table.Column<long>(type: "bigint", nullable: false),
Name = table.Column<string>(type: "text", nullable: false),
Text = table.Column<string>(type: "text", nullable: false),
Price = table.Column<decimal>(type: "numeric", nullable: false),
ChargeCrystalNum = table.Column<int>(type: "integer", nullable: false),
FreeCrystalNum = table.Column<int>(type: "integer", nullable: false),
PurchaseLimit = table.Column<int>(type: "integer", nullable: false),
SpecialShopFlag = table.Column<int>(type: "integer", nullable: false),
ImageName = table.Column<string>(type: "text", nullable: false),
StartTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
EndTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
RemainingTime = table.Column<int>(type: "integer", nullable: false),
IsResaleProduct = table.Column<int>(type: "integer", nullable: false),
ResaleStartDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PaymentItems", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PaymentItems");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,46 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SVSim.Database.Migrations
{
/// <inheritdoc />
public partial class PracticeOpponents : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "PracticeOpponents",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
PracticeId = table.Column<int>(type: "integer", nullable: false),
TextId = table.Column<string>(type: "text", nullable: false),
ClassId = table.Column<int>(type: "integer", nullable: false),
CharaId = table.Column<int>(type: "integer", nullable: false),
DegreeId = table.Column<int>(type: "integer", nullable: false),
AiDeckLevel = table.Column<int>(type: "integer", nullable: false),
AiLogicLevel = table.Column<int>(type: "integer", nullable: false),
AiMaxLife = table.Column<int>(type: "integer", nullable: false),
Battle3dFieldId = table.Column<string>(type: "text", nullable: false),
IsMaintenance = table.Column<bool>(type: "boolean", nullable: false),
IsCampaignPractice = table.Column<bool>(type: "boolean", nullable: false),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PracticeOpponents", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PracticeOpponents");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,135 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace SVSim.Database.Migrations
{
/// <inheritdoc />
public partial class AddPackCatalog : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Packs",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
BasePackId = table.Column<int>(type: "integer", nullable: false),
GachaType = table.Column<int>(type: "integer", nullable: false),
PackCategory = table.Column<int>(type: "integer", nullable: false),
PosterType = table.Column<int>(type: "integer", nullable: false),
CommenceDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CompleteDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
SalesPeriodTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
SleeveId = table.Column<int>(type: "integer", nullable: false),
SpecialSleeveId = table.Column<int>(type: "integer", nullable: false),
OverrideDrawEffectPackId = table.Column<int>(type: "integer", nullable: false),
OverrideUiEffectPackId = table.Column<int>(type: "integer", nullable: false),
GachaDetail = table.Column<string>(type: "text", nullable: false),
IsHide = table.Column<bool>(type: "boolean", nullable: false),
IsNew = table.Column<bool>(type: "boolean", nullable: false),
IsPreRelease = table.Column<bool>(type: "boolean", nullable: false),
OpenCountLimit = table.Column<int>(type: "integer", nullable: false),
GachaPointConfig_ExchangeablePoint = table.Column<int>(type: "integer", nullable: true),
GachaPointConfig_IncreaseGachaPoint = table.Column<int>(type: "integer", nullable: true),
DateCreated = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
DateUpdated = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Packs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "ViewerPackOpenCount",
columns: table => new
{
ViewerId = table.Column<long>(type: "bigint", nullable: false),
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
PackId = table.Column<int>(type: "integer", nullable: false),
OpenCount = table.Column<int>(type: "integer", nullable: false),
LastDailyFreeAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ViewerPackOpenCount", x => new { x.ViewerId, x.Id });
table.ForeignKey(
name: "FK_ViewerPackOpenCount_Viewers_ViewerId",
column: x => x.ViewerId,
principalTable: "Viewers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "PackBannerEntry",
columns: table => new
{
PackConfigEntryId = table.Column<int>(type: "integer", nullable: false),
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
BannerName = table.Column<string>(type: "text", nullable: false),
DialogTitle = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PackBannerEntry", x => new { x.PackConfigEntryId, x.Id });
table.ForeignKey(
name: "FK_PackBannerEntry_Packs_PackConfigEntryId",
column: x => x.PackConfigEntryId,
principalTable: "Packs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "PackChildGachaEntry",
columns: table => new
{
PackConfigEntryId = table.Column<int>(type: "integer", nullable: false),
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
GachaId = table.Column<int>(type: "integer", nullable: false),
TypeDetail = table.Column<int>(type: "integer", nullable: false),
Cost = table.Column<int>(type: "integer", nullable: false),
CardCount = table.Column<int>(type: "integer", nullable: false),
ItemId = table.Column<long>(type: "bigint", nullable: true),
IsDailySingle = table.Column<bool>(type: "boolean", nullable: false),
OverrideIncreaseGachaPoint = table.Column<int>(type: "integer", nullable: false),
PurchaseLimitCount = table.Column<int>(type: "integer", nullable: false),
FreeGachaCampaignId = table.Column<int>(type: "integer", nullable: true),
CampaignName = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PackChildGachaEntry", x => new { x.PackConfigEntryId, x.Id });
table.ForeignKey(
name: "FK_PackChildGachaEntry_Packs_PackConfigEntryId",
column: x => x.PackConfigEntryId,
principalTable: "Packs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PackBannerEntry");
migrationBuilder.DropTable(
name: "PackChildGachaEntry");
migrationBuilder.DropTable(
name: "ViewerPackOpenCount");
migrationBuilder.DropTable(
name: "Packs");
}
}
}

View File

@@ -1,338 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SVSim.Database.Migrations
{
/// <inheritdoc />
public partial class RefactorGameConfigurationToJsonb : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// Step 1: Add the new jsonb column FIRST so the backfill SQL can read the old columns.
migrationBuilder.AddColumn<string>(
name: "Config",
table: "GameConfigurations",
type: "jsonb",
nullable: false,
defaultValue: "");
// Step 2: Backfill — project old flat columns into the new jsonb document.
// For fresh-install databases (no pre-existing rows) this is a no-op; the
// DefaultSettingsSeeder InsertData in the previous migration already seeded the
// parent row, so the UPDATE below covers it. PackRates defaults are hard-coded
// here because the old schema had no equivalent columns.
// Use provider-specific SQL: PostgreSQL jsonb functions vs SQLite json functions.
migrationBuilder.Sql(
"""
UPDATE "GameConfigurations"
SET "Config" = jsonb_build_object(
'DefaultGrants', jsonb_build_object(
'Crystals', "DefaultCrystals",
'Rupees', "DefaultRupees",
'Ether', "DefaultEther"
),
'Player', jsonb_build_object(
'MaxFriends', "MaxFriends"
),
'DefaultLoadout', jsonb_build_object(
'DegreeId', "DefaultDegreeId",
'EmblemId', "DefaultEmblemId",
'MyPageBackgroundId', "DefaultMyPageBackgroundId",
'SleeveId', "DefaultSleeveId"
),
'Challenge', jsonb_build_object(
'UseTwoPickPremiumCard', "ChallengeUseTwoPickPremiumCard",
'TwoPickSleeveId', "ChallengeTwoPickSleeveId"
),
'Rotation', jsonb_build_object(
'TsRotationId', "TsRotationId",
'IsBattlePassPeriod', "IsBattlePassPeriod",
'IsBeginnerMission', "IsBeginnerMission",
'CardSetIdForResourceDlView', "CardSetIdForResourceDlView"
),
'PackRates', jsonb_build_object(
'AnimatedRate', 0.08,
'Default', jsonb_build_object('Bronze', 0.6744, 'Silver', 0.25, 'Gold', 0.06, 'Legendary', 0.015),
'PerSlot', jsonb_build_array(
jsonb_build_object('Slot', '8', 'Bronze', 0, 'Silver', 0.7692, 'Gold', 0.1846, 'Legendary', 0.0462)
)
)
)
WHERE "Id" = 'default';
""",
suppressTransaction: true);
// For SQLite (tests): use json() and json_object() functions.
migrationBuilder.Sql(
"""
UPDATE "GameConfigurations"
SET "Config" = json('{"DefaultGrants":{"Crystals":'||COALESCE("DefaultCrystals", 0)||',"Rupees":'||COALESCE("DefaultRupees", 0)||',"Ether":'||COALESCE("DefaultEther", 0)||'},'||
'"Player":{"MaxFriends":'||COALESCE("MaxFriends", 0)||'},'||
'"DefaultLoadout":{"DegreeId":'||COALESCE("DefaultDegreeId", 0)||',"EmblemId":'||COALESCE("DefaultEmblemId", 0)||',"MyPageBackgroundId":'||COALESCE("DefaultMyPageBackgroundId", 0)||',"SleeveId":'||COALESCE("DefaultSleeveId", 0)||'},'||
'"Challenge":{"UseTwoPickPremiumCard":'||(CASE WHEN "ChallengeUseTwoPickPremiumCard" THEN 'true' ELSE 'false' END)||',"TwoPickSleeveId":'||COALESCE("ChallengeTwoPickSleeveId", 0)||'},'||
'"Rotation":{"TsRotationId":"'||COALESCE("TsRotationId", '')||'","IsBattlePassPeriod":'||(CASE WHEN "IsBattlePassPeriod" THEN 'true' ELSE 'false' END)||',"IsBeginnerMission":'||(CASE WHEN "IsBeginnerMission" THEN 'true' ELSE 'false' END)||',"CardSetIdForResourceDlView":'||COALESCE("CardSetIdForResourceDlView", 0)||'},'||
'"PackRates":{"AnimatedRate":0.08,"Default":{"Bronze":0.6744,"Silver":0.25,"Gold":0.06,"Legendary":0.015},"PerSlot":[{"Slot":"8","Bronze":0,"Silver":0.7692,"Gold":0.1846,"Legendary":0.0462}]}'||
'}')
WHERE "Id" = 'default';
""",
suppressTransaction: true);
// Step 3: Drop FK constraints, indexes, and old flat columns.
migrationBuilder.DropForeignKey(
name: "FK_GameConfigurations_Degrees_DefaultDegreeId",
table: "GameConfigurations");
migrationBuilder.DropForeignKey(
name: "FK_GameConfigurations_Emblems_DefaultEmblemId",
table: "GameConfigurations");
migrationBuilder.DropForeignKey(
name: "FK_GameConfigurations_MyPageBackgrounds_DefaultMyPageBackgroun~",
table: "GameConfigurations");
migrationBuilder.DropForeignKey(
name: "FK_GameConfigurations_Sleeves_DefaultSleeveId",
table: "GameConfigurations");
migrationBuilder.DropIndex(
name: "IX_GameConfigurations_DefaultDegreeId",
table: "GameConfigurations");
migrationBuilder.DropIndex(
name: "IX_GameConfigurations_DefaultEmblemId",
table: "GameConfigurations");
migrationBuilder.DropIndex(
name: "IX_GameConfigurations_DefaultMyPageBackgroundId",
table: "GameConfigurations");
migrationBuilder.DropIndex(
name: "IX_GameConfigurations_DefaultSleeveId",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "CardSetIdForResourceDlView",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "ChallengeTwoPickSleeveId",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "ChallengeUseTwoPickPremiumCard",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "DefaultCrystals",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "DefaultDegreeId",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "DefaultEmblemId",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "DefaultEther",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "DefaultMyPageBackgroundId",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "DefaultRupees",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "DefaultSleeveId",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "IsBattlePassPeriod",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "IsBeginnerMission",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "MaxFriends",
table: "GameConfigurations");
migrationBuilder.DropColumn(
name: "TsRotationId",
table: "GameConfigurations");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Config",
table: "GameConfigurations");
migrationBuilder.AddColumn<int>(
name: "CardSetIdForResourceDlView",
table: "GameConfigurations",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<long>(
name: "ChallengeTwoPickSleeveId",
table: "GameConfigurations",
type: "bigint",
nullable: false,
defaultValue: 0L);
migrationBuilder.AddColumn<bool>(
name: "ChallengeUseTwoPickPremiumCard",
table: "GameConfigurations",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<decimal>(
name: "DefaultCrystals",
table: "GameConfigurations",
type: "numeric(20,0)",
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<int>(
name: "DefaultDegreeId",
table: "GameConfigurations",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "DefaultEmblemId",
table: "GameConfigurations",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<decimal>(
name: "DefaultEther",
table: "GameConfigurations",
type: "numeric(20,0)",
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<int>(
name: "DefaultMyPageBackgroundId",
table: "GameConfigurations",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<decimal>(
name: "DefaultRupees",
table: "GameConfigurations",
type: "numeric(20,0)",
nullable: false,
defaultValue: 0m);
migrationBuilder.AddColumn<int>(
name: "DefaultSleeveId",
table: "GameConfigurations",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<bool>(
name: "IsBattlePassPeriod",
table: "GameConfigurations",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "IsBeginnerMission",
table: "GameConfigurations",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>(
name: "MaxFriends",
table: "GameConfigurations",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<string>(
name: "TsRotationId",
table: "GameConfigurations",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.UpdateData(
table: "GameConfigurations",
keyColumn: "Id",
keyValue: "default",
columns: new[] { "CardSetIdForResourceDlView", "ChallengeTwoPickSleeveId", "ChallengeUseTwoPickPremiumCard", "DefaultCrystals", "DefaultDegreeId", "DefaultEmblemId", "DefaultEther", "DefaultMyPageBackgroundId", "DefaultRupees", "DefaultSleeveId", "IsBattlePassPeriod", "IsBeginnerMission", "MaxFriends", "TsRotationId" },
values: new object[] { 0, 0L, false, 50000m, 300003, 100000000, 50000m, 100000000, 50000m, 3000011, false, false, 20, "" });
migrationBuilder.CreateIndex(
name: "IX_GameConfigurations_DefaultDegreeId",
table: "GameConfigurations",
column: "DefaultDegreeId");
migrationBuilder.CreateIndex(
name: "IX_GameConfigurations_DefaultEmblemId",
table: "GameConfigurations",
column: "DefaultEmblemId");
migrationBuilder.CreateIndex(
name: "IX_GameConfigurations_DefaultMyPageBackgroundId",
table: "GameConfigurations",
column: "DefaultMyPageBackgroundId");
migrationBuilder.CreateIndex(
name: "IX_GameConfigurations_DefaultSleeveId",
table: "GameConfigurations",
column: "DefaultSleeveId");
migrationBuilder.AddForeignKey(
name: "FK_GameConfigurations_Degrees_DefaultDegreeId",
table: "GameConfigurations",
column: "DefaultDegreeId",
principalTable: "Degrees",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_GameConfigurations_Emblems_DefaultEmblemId",
table: "GameConfigurations",
column: "DefaultEmblemId",
principalTable: "Emblems",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_GameConfigurations_MyPageBackgrounds_DefaultMyPageBackgroun~",
table: "GameConfigurations",
column: "DefaultMyPageBackgroundId",
principalTable: "MyPageBackgrounds",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_GameConfigurations_Sleeves_DefaultSleeveId",
table: "GameConfigurations",
column: "DefaultSleeveId",
principalTable: "Sleeves",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,29 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SVSim.Database.Migrations
{
/// <inheritdoc />
public partial class AddIsFoilToCards : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsFoil",
table: "Cards",
type: "boolean",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsFoil",
table: "Cards");
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff