Pack opening
This commit is contained in:
34843
SVSim.Database/Migrations/20260524044535_AddPackCatalog.Designer.cs
generated
Normal file
34843
SVSim.Database/Migrations/20260524044535_AddPackCatalog.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
135
SVSim.Database/Migrations/20260524044535_AddPackCatalog.cs
Normal file
135
SVSim.Database/Migrations/20260524044535_AddPackCatalog.cs
Normal file
@@ -0,0 +1,135 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25422,6 +25422,71 @@ namespace SVSim.Database.Migrations
|
||||
b.ToTable("MyRotationSettings");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Models.PackConfigEntry", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("BasePackId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("CommenceDate")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime>("CompleteDate")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime>("DateCreated")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime?>("DateUpdated")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("GachaDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("GachaType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("IsHide")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("IsNew")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<bool>("IsPreRelease")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int>("OpenCountLimit")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("OverrideDrawEffectPackId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("OverrideUiEffectPackId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("PackCategory")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("PosterType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime?>("SalesPeriodTime")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int>("SleeveId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("SpecialSleeveId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Packs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Models.PaymentItemEntry", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -34209,6 +34274,110 @@ namespace SVSim.Database.Migrations
|
||||
b.Navigation("Class");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Models.PackConfigEntry", b =>
|
||||
{
|
||||
b.OwnsMany("SVSim.Database.Models.PackBannerEntry", "Banners", b1 =>
|
||||
{
|
||||
b1.Property<int>("PackConfigEntryId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));
|
||||
|
||||
b1.Property<string>("BannerName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("DialogTitle")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.HasKey("PackConfigEntryId", "Id");
|
||||
|
||||
b1.ToTable("PackBannerEntry");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("PackConfigEntryId");
|
||||
});
|
||||
|
||||
b.OwnsMany("SVSim.Database.Models.PackChildGachaEntry", "ChildGachas", b1 =>
|
||||
{
|
||||
b1.Property<int>("PackConfigEntryId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));
|
||||
|
||||
b1.Property<string>("CampaignName")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<int>("CardCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.Property<int>("Cost")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.Property<int?>("FreeGachaCampaignId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.Property<int>("GachaId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.Property<bool>("IsDailySingle")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b1.Property<long?>("ItemId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<int>("OverrideIncreaseGachaPoint")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.Property<int>("PurchaseLimitCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.Property<int>("TypeDetail")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.HasKey("PackConfigEntryId", "Id");
|
||||
|
||||
b1.ToTable("PackChildGachaEntry");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("PackConfigEntryId");
|
||||
});
|
||||
|
||||
b.OwnsOne("SVSim.Database.Models.PackGachaPointConfig", "GachaPointConfig", b1 =>
|
||||
{
|
||||
b1.Property<int>("PackConfigEntryId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.Property<int>("ExchangeablePoint")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.Property<int>("IncreaseGachaPoint")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.HasKey("PackConfigEntryId");
|
||||
|
||||
b1.ToTable("Packs");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("PackConfigEntryId");
|
||||
});
|
||||
|
||||
b.Navigation("Banners");
|
||||
|
||||
b.Navigation("ChildGachas");
|
||||
|
||||
b.Navigation("GachaPointConfig");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Models.ShadowverseCardEntry", b =>
|
||||
{
|
||||
b.HasOne("SVSim.Database.Models.ClassEntry", "Class")
|
||||
@@ -34588,6 +34757,34 @@ namespace SVSim.Database.Migrations
|
||||
.HasForeignKey("ViewerId");
|
||||
});
|
||||
|
||||
b.OwnsMany("SVSim.Database.Models.ViewerPackOpenCount", "PackOpenCounts", b1 =>
|
||||
{
|
||||
b1.Property<long>("ViewerId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));
|
||||
|
||||
b1.Property<DateTime?>("LastDailyFreeAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b1.Property<int>("OpenCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.Property<int>("PackId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.HasKey("ViewerId", "Id");
|
||||
|
||||
b1.ToTable("ViewerPackOpenCount");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("ViewerId");
|
||||
});
|
||||
|
||||
b.Navigation("Cards");
|
||||
|
||||
b.Navigation("Classes");
|
||||
@@ -34603,6 +34800,8 @@ namespace SVSim.Database.Migrations
|
||||
b.Navigation("MissionData")
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("PackOpenCounts");
|
||||
|
||||
b.Navigation("SocialAccountConnections");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user