This commit is contained in:
gamer147
2026-05-25 14:36:12 -04:00
parent 558e8288eb
commit 5e7a65fe5a
54 changed files with 39633 additions and 29 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,283 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace SVSim.Database.Migrations
{
/// <inheritdoc />
public partial class Story : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "SpecialBattleSettings",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
PlayerFirstTurn = table.Column<int>(type: "integer", nullable: false),
PlayerStartPp = table.Column<int>(type: "integer", nullable: false),
EnemyStartPp = table.Column<int>(type: "integer", nullable: false),
PlayerStartLife = table.Column<int>(type: "integer", nullable: false),
EnemyStartLife = table.Column<int>(type: "integer", nullable: false),
PlayerAttachSkill = table.Column<string>(type: "text", nullable: false),
EnemyAttachSkill = table.Column<string>(type: "text", nullable: false),
IdOverrideInBattleLog = table.Column<string>(type: "text", nullable: false),
BanishEffectOverride = table.Column<string>(type: "text", nullable: false),
TokenDrawEffectOverride = table.Column<string>(type: "text", nullable: false),
SpecialTokenDrawEffectOverride = table.Column<string>(type: "text", nullable: false),
ResultSkip = table.Column<int>(type: "integer", nullable: false),
VsEffectOverride = table.Column<int>(type: "integer", nullable: false),
ClassDestroyEffectOverride = table.Column<int>(type: "integer", nullable: false),
Note = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_SpecialBattleSettings", x => x.Id);
});
migrationBuilder.CreateTable(
name: "StoryWorlds",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
TitleTextKey = table.Column<string>(type: "text", nullable: false),
PanelImageName = table.Column<string>(type: "text", nullable: false),
RibbonText = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_StoryWorlds", x => x.Id);
});
migrationBuilder.CreateTable(
name: "ViewerStoryBranchUnlocks",
columns: table => new
{
ViewerId = table.Column<long>(type: "bigint", nullable: false),
StoryId = table.Column<int>(type: "integer", nullable: false),
UnlockedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ViewerStoryBranchUnlocks", x => new { x.ViewerId, x.StoryId });
});
migrationBuilder.CreateTable(
name: "ViewerStoryProgress",
columns: table => new
{
ViewerId = table.Column<long>(type: "bigint", nullable: false),
StoryId = table.Column<int>(type: "integer", nullable: false),
IsFinish = table.Column<bool>(type: "boolean", nullable: false),
IsSkipped = table.Column<bool>(type: "boolean", nullable: false),
FinishedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
SkippedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ViewerStoryProgress", x => new { x.ViewerId, x.StoryId });
});
migrationBuilder.CreateTable(
name: "StorySections",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false),
WorldId = table.Column<int>(type: "integer", nullable: true),
StoryApiType = table.Column<int>(type: "integer", nullable: false),
OrderId = table.Column<int>(type: "integer", nullable: false),
AllStoryOrderId = table.Column<int>(type: "integer", nullable: false),
NameTextKey = table.Column<string>(type: "text", nullable: false),
ImageName = table.Column<string>(type: "text", nullable: false),
IsLeaderSelect = table.Column<bool>(type: "boolean", nullable: false),
BackGroundId = table.Column<int>(type: "integer", nullable: false),
ChapterSelectType = table.Column<int>(type: "integer", nullable: false),
StoryTypeOverwrite = table.Column<int>(type: "integer", nullable: false),
IsUnderMaintenance = table.Column<bool>(type: "boolean", nullable: false),
IsPlayAnotherEndAppearanceAnimation = table.Column<bool>(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_StorySections", x => x.Id);
table.ForeignKey(
name: "FK_StorySections_StoryWorlds_WorldId",
column: x => x.WorldId,
principalTable: "StoryWorlds",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "StoryChapters",
columns: table => new
{
StoryId = table.Column<int>(type: "integer", nullable: false),
SectionId = table.Column<int>(type: "integer", nullable: false),
CharaId = table.Column<int>(type: "integer", nullable: false),
ChapterId = table.Column<string>(type: "text", nullable: false),
NextChapterId = table.Column<string>(type: "text", nullable: false),
RequiredChapterId = table.Column<string>(type: "text", nullable: true),
SelectionDisplayPosition = table.Column<string>(type: "text", nullable: true),
SelectionTextId = table.Column<string>(type: "text", nullable: true),
XCoordinate = table.Column<decimal>(type: "numeric", nullable: false),
YCoordinate = table.Column<decimal>(type: "numeric", nullable: false),
ShowCoordinate = table.Column<int>(type: "integer", nullable: false),
IsCameraMovable = table.Column<int>(type: "integer", nullable: false),
ShowSubtitles = table.Column<int>(type: "integer", nullable: false),
BattleExists = table.Column<bool>(type: "boolean", nullable: false),
EnemyCharaId = table.Column<int>(type: "integer", nullable: false),
EnemyClass = table.Column<int>(type: "integer", nullable: false),
EnemyAiId = table.Column<int>(type: "integer", nullable: false),
BgFileName = table.Column<string>(type: "text", nullable: false),
ChapterEffectPath = table.Column<string>(type: "text", nullable: true),
ChapterClearTextId = table.Column<string>(type: "text", nullable: true),
Battle3dFieldId = table.Column<int>(type: "integer", nullable: false),
BgmId = table.Column<string>(type: "text", nullable: false),
SpecialBattleSettingId = table.Column<int>(type: "integer", nullable: true),
ReleasePoint = table.Column<int>(type: "integer", nullable: false),
IsMaintenanceChapter = table.Column<bool>(type: "boolean", nullable: false),
IsPlayAnotherEndAppearanceAnimation = table.Column<bool>(type: "boolean", nullable: false),
IsReleasedAnotherEnd = table.Column<bool>(type: "boolean", nullable: false),
IsSkipEnabled = table.Column<bool>(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_StoryChapters", x => x.StoryId);
table.ForeignKey(
name: "FK_StoryChapters_SpecialBattleSettings_SpecialBattleSettingId",
column: x => x.SpecialBattleSettingId,
principalTable: "SpecialBattleSettings",
principalColumn: "Id");
table.ForeignKey(
name: "FK_StoryChapters_StorySections_SectionId",
column: x => x.SectionId,
principalTable: "StorySections",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "StoryChapterBattleSetting",
columns: table => new
{
StoryId = table.Column<int>(type: "integer", nullable: false),
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
DeckClassId = table.Column<int>(type: "integer", nullable: false),
PlayerEmotionOverride = table.Column<int>(type: "integer", nullable: false),
EnemyEmotionOverride = table.Column<int>(type: "integer", nullable: false),
SkinIdOverride = table.Column<int>(type: "integer", nullable: false),
Battle3dFieldIdOverride = table.Column<int>(type: "integer", nullable: false),
BgmIdOverride = table.Column<int>(type: "integer", nullable: false),
DeckSkinIdOverride = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_StoryChapterBattleSetting", x => new { x.StoryId, x.Id });
table.ForeignKey(
name: "FK_StoryChapterBattleSetting_StoryChapters_StoryId",
column: x => x.StoryId,
principalTable: "StoryChapters",
principalColumn: "StoryId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "StoryChapterReward",
columns: table => new
{
StoryId = table.Column<int>(type: "integer", nullable: false),
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
RewardType = table.Column<int>(type: "integer", nullable: false),
RewardDetailId = table.Column<long>(type: "bigint", nullable: false),
RewardNumber = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_StoryChapterReward", x => new { x.StoryId, x.Id });
table.ForeignKey(
name: "FK_StoryChapterReward_StoryChapters_StoryId",
column: x => x.StoryId,
principalTable: "StoryChapters",
principalColumn: "StoryId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "StorySubChapter",
columns: table => new
{
StoryId = table.Column<int>(type: "integer", nullable: false),
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
SubChapterId = table.Column<int>(type: "integer", nullable: false),
SubChapterStoryId = table.Column<int>(type: "integer", nullable: false),
IsMaintenanceChapter = table.Column<bool>(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_StorySubChapter", x => new { x.StoryId, x.Id });
table.ForeignKey(
name: "FK_StorySubChapter_StoryChapters_StoryId",
column: x => x.StoryId,
principalTable: "StoryChapters",
principalColumn: "StoryId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_StoryChapters_NextChapterId",
table: "StoryChapters",
column: "NextChapterId");
migrationBuilder.CreateIndex(
name: "IX_StoryChapters_SectionId_CharaId_ChapterId",
table: "StoryChapters",
columns: new[] { "SectionId", "CharaId", "ChapterId" });
migrationBuilder.CreateIndex(
name: "IX_StoryChapters_SpecialBattleSettingId",
table: "StoryChapters",
column: "SpecialBattleSettingId");
migrationBuilder.CreateIndex(
name: "IX_StorySections_WorldId",
table: "StorySections",
column: "WorldId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "StoryChapterBattleSetting");
migrationBuilder.DropTable(
name: "StoryChapterReward");
migrationBuilder.DropTable(
name: "StorySubChapter");
migrationBuilder.DropTable(
name: "ViewerStoryBranchUnlocks");
migrationBuilder.DropTable(
name: "ViewerStoryProgress");
migrationBuilder.DropTable(
name: "StoryChapters");
migrationBuilder.DropTable(
name: "SpecialBattleSettings");
migrationBuilder.DropTable(
name: "StorySections");
migrationBuilder.DropTable(
name: "StoryWorlds");
}
}
}

View File

@@ -85,6 +85,281 @@ namespace SVSim.Database.Migrations
b.ToTable("MyPageBackgroundEntryViewer");
});
modelBuilder.Entity("SVSim.Database.Entities.Story.SpecialBattleSetting", b =>
{
b.Property<int>("Id")
.HasColumnType("integer");
b.Property<string>("BanishEffectOverride")
.IsRequired()
.HasColumnType("text");
b.Property<int>("ClassDestroyEffectOverride")
.HasColumnType("integer");
b.Property<string>("EnemyAttachSkill")
.IsRequired()
.HasColumnType("text");
b.Property<int>("EnemyStartLife")
.HasColumnType("integer");
b.Property<int>("EnemyStartPp")
.HasColumnType("integer");
b.Property<string>("IdOverrideInBattleLog")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Note")
.HasColumnType("text");
b.Property<string>("PlayerAttachSkill")
.IsRequired()
.HasColumnType("text");
b.Property<int>("PlayerFirstTurn")
.HasColumnType("integer");
b.Property<int>("PlayerStartLife")
.HasColumnType("integer");
b.Property<int>("PlayerStartPp")
.HasColumnType("integer");
b.Property<int>("ResultSkip")
.HasColumnType("integer");
b.Property<string>("SpecialTokenDrawEffectOverride")
.IsRequired()
.HasColumnType("text");
b.Property<string>("TokenDrawEffectOverride")
.IsRequired()
.HasColumnType("text");
b.Property<int>("VsEffectOverride")
.HasColumnType("integer");
b.HasKey("Id");
b.ToTable("SpecialBattleSettings");
});
modelBuilder.Entity("SVSim.Database.Entities.Story.StoryChapter", b =>
{
b.Property<int>("StoryId")
.HasColumnType("integer");
b.Property<int>("Battle3dFieldId")
.HasColumnType("integer");
b.Property<bool>("BattleExists")
.HasColumnType("boolean");
b.Property<string>("BgFileName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("BgmId")
.IsRequired()
.HasColumnType("text");
b.Property<string>("ChapterClearTextId")
.HasColumnType("text");
b.Property<string>("ChapterEffectPath")
.HasColumnType("text");
b.Property<string>("ChapterId")
.IsRequired()
.HasColumnType("text");
b.Property<int>("CharaId")
.HasColumnType("integer");
b.Property<int>("EnemyAiId")
.HasColumnType("integer");
b.Property<int>("EnemyCharaId")
.HasColumnType("integer");
b.Property<int>("EnemyClass")
.HasColumnType("integer");
b.Property<int>("IsCameraMovable")
.HasColumnType("integer");
b.Property<bool>("IsMaintenanceChapter")
.HasColumnType("boolean");
b.Property<bool>("IsPlayAnotherEndAppearanceAnimation")
.HasColumnType("boolean");
b.Property<bool>("IsReleasedAnotherEnd")
.HasColumnType("boolean");
b.Property<bool>("IsSkipEnabled")
.HasColumnType("boolean");
b.Property<string>("NextChapterId")
.IsRequired()
.HasColumnType("text");
b.Property<int>("ReleasePoint")
.HasColumnType("integer");
b.Property<string>("RequiredChapterId")
.HasColumnType("text");
b.Property<int>("SectionId")
.HasColumnType("integer");
b.Property<string>("SelectionDisplayPosition")
.HasColumnType("text");
b.Property<string>("SelectionTextId")
.HasColumnType("text");
b.Property<int>("ShowCoordinate")
.HasColumnType("integer");
b.Property<int>("ShowSubtitles")
.HasColumnType("integer");
b.Property<int?>("SpecialBattleSettingId")
.HasColumnType("integer");
b.Property<decimal>("XCoordinate")
.HasColumnType("numeric");
b.Property<decimal>("YCoordinate")
.HasColumnType("numeric");
b.HasKey("StoryId");
b.HasIndex("NextChapterId");
b.HasIndex("SpecialBattleSettingId");
b.HasIndex("SectionId", "CharaId", "ChapterId");
b.ToTable("StoryChapters");
});
modelBuilder.Entity("SVSim.Database.Entities.Story.StorySection", b =>
{
b.Property<int>("Id")
.HasColumnType("integer");
b.Property<int>("AllStoryOrderId")
.HasColumnType("integer");
b.Property<int>("BackGroundId")
.HasColumnType("integer");
b.Property<int>("ChapterSelectType")
.HasColumnType("integer");
b.Property<string>("ImageName")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("IsLeaderSelect")
.HasColumnType("boolean");
b.Property<bool>("IsPlayAnotherEndAppearanceAnimation")
.HasColumnType("boolean");
b.Property<bool>("IsUnderMaintenance")
.HasColumnType("boolean");
b.Property<string>("NameTextKey")
.IsRequired()
.HasColumnType("text");
b.Property<int>("OrderId")
.HasColumnType("integer");
b.Property<int>("StoryApiType")
.HasColumnType("integer");
b.Property<int>("StoryTypeOverwrite")
.HasColumnType("integer");
b.Property<int?>("WorldId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("WorldId");
b.ToTable("StorySections");
});
modelBuilder.Entity("SVSim.Database.Entities.Story.StoryWorld", b =>
{
b.Property<int>("Id")
.HasColumnType("integer");
b.Property<string>("PanelImageName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("RibbonText")
.IsRequired()
.HasColumnType("text");
b.Property<string>("TitleTextKey")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("StoryWorlds");
});
modelBuilder.Entity("SVSim.Database.Entities.Story.ViewerStoryBranchUnlock", b =>
{
b.Property<long>("ViewerId")
.HasColumnType("bigint");
b.Property<int>("StoryId")
.HasColumnType("integer");
b.Property<DateTime>("UnlockedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("ViewerId", "StoryId");
b.ToTable("ViewerStoryBranchUnlocks");
});
modelBuilder.Entity("SVSim.Database.Entities.Story.ViewerStoryProgress", b =>
{
b.Property<long>("ViewerId")
.HasColumnType("bigint");
b.Property<int>("StoryId")
.HasColumnType("integer");
b.Property<DateTime?>("FinishedAt")
.HasColumnType("timestamp with time zone");
b.Property<bool>("IsFinish")
.HasColumnType("boolean");
b.Property<bool>("IsSkipped")
.HasColumnType("boolean");
b.Property<DateTime?>("SkippedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("ViewerId", "StoryId");
b.ToTable("ViewerStoryProgress");
});
modelBuilder.Entity("SVSim.Database.Models.ArenaSeasonConfig", b =>
{
b.Property<int>("Id")
@@ -1562,6 +1837,134 @@ namespace SVSim.Database.Migrations
.IsRequired();
});
modelBuilder.Entity("SVSim.Database.Entities.Story.StoryChapter", b =>
{
b.HasOne("SVSim.Database.Entities.Story.StorySection", "Section")
.WithMany()
.HasForeignKey("SectionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("SVSim.Database.Entities.Story.SpecialBattleSetting", "SpecialBattleSetting")
.WithMany()
.HasForeignKey("SpecialBattleSettingId");
b.OwnsMany("SVSim.Database.Entities.Story.StoryChapterBattleSetting", "BattleSettings", b1 =>
{
b1.Property<int>("StoryId")
.HasColumnType("integer");
b1.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));
b1.Property<int>("Battle3dFieldIdOverride")
.HasColumnType("integer");
b1.Property<int>("BgmIdOverride")
.HasColumnType("integer");
b1.Property<int>("DeckClassId")
.HasColumnType("integer");
b1.Property<int>("DeckSkinIdOverride")
.HasColumnType("integer");
b1.Property<int>("EnemyEmotionOverride")
.HasColumnType("integer");
b1.Property<int>("PlayerEmotionOverride")
.HasColumnType("integer");
b1.Property<int>("SkinIdOverride")
.HasColumnType("integer");
b1.HasKey("StoryId", "Id");
b1.ToTable("StoryChapterBattleSetting");
b1.WithOwner()
.HasForeignKey("StoryId");
});
b.OwnsMany("SVSim.Database.Entities.Story.StoryChapterReward", "Rewards", b1 =>
{
b1.Property<int>("StoryId")
.HasColumnType("integer");
b1.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));
b1.Property<long>("RewardDetailId")
.HasColumnType("bigint");
b1.Property<int>("RewardNumber")
.HasColumnType("integer");
b1.Property<int>("RewardType")
.HasColumnType("integer");
b1.HasKey("StoryId", "Id");
b1.ToTable("StoryChapterReward");
b1.WithOwner()
.HasForeignKey("StoryId");
});
b.OwnsMany("SVSim.Database.Entities.Story.StorySubChapter", "SubChapters", b1 =>
{
b1.Property<int>("StoryId")
.HasColumnType("integer");
b1.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));
b1.Property<bool>("IsMaintenanceChapter")
.HasColumnType("boolean");
b1.Property<int>("SubChapterId")
.HasColumnType("integer");
b1.Property<int>("SubChapterStoryId")
.HasColumnType("integer");
b1.HasKey("StoryId", "Id");
b1.ToTable("StorySubChapter");
b1.WithOwner()
.HasForeignKey("StoryId");
});
b.Navigation("BattleSettings");
b.Navigation("Rewards");
b.Navigation("Section");
b.Navigation("SpecialBattleSetting");
b.Navigation("SubChapters");
});
modelBuilder.Entity("SVSim.Database.Entities.Story.StorySection", b =>
{
b.HasOne("SVSim.Database.Entities.Story.StoryWorld", "World")
.WithMany()
.HasForeignKey("WorldId");
b.Navigation("World");
});
modelBuilder.Entity("SVSim.Database.Models.CardCosmeticReward", b =>
{
b.HasOne("SVSim.Database.Models.ShadowverseCardEntry", "Card")