136 lines
7.1 KiB
C#
136 lines
7.1 KiB
C#
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");
|
|
}
|
|
}
|
|
}
|