// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using SVSim.Database;

#nullable disable

namespace SVSim.Database.Migrations
{
    [DbContext(typeof(SVSimDbContext))]
    [Migration("20260609012522_AddPackChildGachaDailyFreeGachaCount")]
    partial class AddPackChildGachaDailyFreeGachaCount
    {
        /// <inheritdoc />
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "8.0.8")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);

            modelBuilder.HasSequence("ShortUdidSequence")
                .StartsAt(400000000L);

            modelBuilder.Entity("DegreeEntryViewer", b =>
                {
                    b.Property<int>("DegreesId")
                        .HasColumnType("integer");

                    b.Property<long>("ViewersId")
                        .HasColumnType("bigint");

                    b.HasKey("DegreesId", "ViewersId");

                    b.HasIndex("ViewersId");

                    b.ToTable("DegreeEntryViewer");
                });

            modelBuilder.Entity("EmblemEntryViewer", b =>
                {
                    b.Property<int>("EmblemsId")
                        .HasColumnType("integer");

                    b.Property<long>("ViewersId")
                        .HasColumnType("bigint");

                    b.HasKey("EmblemsId", "ViewersId");

                    b.HasIndex("ViewersId");

                    b.ToTable("EmblemEntryViewer");
                });

            modelBuilder.Entity("LeaderSkinEntryViewer", b =>
                {
                    b.Property<int>("LeaderSkinsId")
                        .HasColumnType("integer");

                    b.Property<long>("ViewersId")
                        .HasColumnType("bigint");

                    b.HasKey("LeaderSkinsId", "ViewersId");

                    b.HasIndex("ViewersId");

                    b.ToTable("LeaderSkinEntryViewer");
                });

            modelBuilder.Entity("MyPageBackgroundEntryViewer", b =>
                {
                    b.Property<int>("MyPageBackgroundsId")
                        .HasColumnType("integer");

                    b.Property<long>("ViewersId")
                        .HasColumnType("bigint");

                    b.HasKey("MyPageBackgroundsId", "ViewersId");

                    b.HasIndex("ViewersId");

                    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<string>("UnlockText")
                        .HasColumnType("text");

                    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<int>("IsSpoiler")
                        .HasColumnType("integer");

                    b.Property<bool>("IsUnderMaintenance")
                        .HasColumnType("boolean");

                    b.Property<string>("NameTextKey")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("OrderId")
                        .HasColumnType("integer");

                    b.Property<string>("SpoilerMessage")
                        .IsRequired()
                        .HasColumnType("text");

                    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.AchievementCatalogEntry", b =>
                {
                    b.Property<int>("AchievementType")
                        .HasColumnType("integer");

                    b.Property<int>("Level")
                        .HasColumnType("integer");

                    b.Property<int?>("EventArg")
                        .HasColumnType("integer");

                    b.Property<string>("EventType")
                        .HasColumnType("text");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("OrderNum")
                        .HasColumnType("integer");

                    b.Property<int>("RequireNumber")
                        .HasColumnType("integer");

                    b.Property<long>("RewardDetailId")
                        .HasColumnType("bigint");

                    b.Property<int>("RewardNumber")
                        .HasColumnType("integer");

                    b.Property<int>("RewardType")
                        .HasColumnType("integer");

                    b.HasKey("AchievementType", "Level");

                    b.HasIndex("AchievementType");

                    b.HasIndex("EventType", "EventArg");

                    b.ToTable("AchievementCatalog");
                });

            modelBuilder.Entity("SVSim.Database.Models.ArenaSeasonConfig", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<decimal>("Cost")
                        .HasColumnType("numeric(20,0)");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("Enable")
                        .HasColumnType("integer");

                    b.Property<string>("FormatInfo")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<bool>("IsJoin")
                        .HasColumnType("boolean");

                    b.Property<int>("Mode")
                        .HasColumnType("integer");

                    b.Property<decimal>("RupyCost")
                        .HasColumnType("numeric(20,0)");

                    b.Property<int>("TicketCost")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.ToTable("ArenaSeasons");
                });

            modelBuilder.Entity("SVSim.Database.Models.ArenaTwoPickReward", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

                    b.Property<int>("RewardGroup")
                        .HasColumnType("integer");

                    b.Property<long>("RewardId")
                        .HasColumnType("bigint");

                    b.Property<int>("RewardNum")
                        .HasColumnType("integer");

                    b.Property<int>("RewardType")
                        .HasColumnType("integer");

                    b.Property<int>("Weight")
                        .HasColumnType("integer");

                    b.Property<int>("WinCount")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("WinCount");

                    b.HasIndex("WinCount", "RewardGroup", "RewardType", "RewardId", "RewardNum")
                        .IsUnique();

                    b.ToTable("ArenaTwoPickRewards");
                });

            modelBuilder.Entity("SVSim.Database.Models.AvatarAbilityEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<string>("Ability")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("AbilityCost")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("AbilityDesc")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("BattleStartFirstPlayerTurnBp")
                        .HasColumnType("integer");

                    b.Property<int>("BattleStartMaxLife")
                        .HasColumnType("integer");

                    b.Property<int>("BattleStartSecondPlayerTurnBp")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("LeaderSkinId")
                        .HasColumnType("integer");

                    b.Property<string>("PassiveAbility")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("PassiveAbilityDesc")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("AvatarAbilities");
                });

            modelBuilder.Entity("SVSim.Database.Models.BannerEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<int>("ChangeTime")
                        .HasColumnType("integer");

                    b.Property<string>("Click")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("ImageName")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("ImagePaths")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<int>("RemainingTime")
                        .HasColumnType("integer");

                    b.Property<string>("Status")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("Banners");
                });

            modelBuilder.Entity("SVSim.Database.Models.BattlePassLevelEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("Level")
                        .HasColumnType("integer");

                    b.Property<int>("RequiredPoint")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.ToTable("BattlePassLevels");
                });

            modelBuilder.Entity("SVSim.Database.Models.BattlePassMonthlyMissionEntry", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));

                    b.Property<int>("BattlePassPoint")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int?>("EventArg")
                        .HasColumnType("integer");

                    b.Property<string>("EventType")
                        .HasColumnType("text");

                    b.Property<int>("Month")
                        .HasColumnType("integer");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("OrderNum")
                        .HasColumnType("integer");

                    b.Property<int>("RequireNumber")
                        .HasColumnType("integer");

                    b.Property<long?>("RewardDetailId")
                        .HasColumnType("bigint");

                    b.Property<int?>("RewardNumber")
                        .HasColumnType("integer");

                    b.Property<int?>("RewardType")
                        .HasColumnType("integer");

                    b.Property<int>("Year")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("Year", "Month");

                    b.HasIndex("Year", "Month", "OrderNum")
                        .IsUnique();

                    b.ToTable("BattlePassMonthlyMissions");
                });

            modelBuilder.Entity("SVSim.Database.Models.BattlePassRewardEntry", b =>
                {
                    b.Property<long>("Id")
                        .HasColumnType("bigint");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("IsAppealExclusion")
                        .HasColumnType("boolean");

                    b.Property<int>("Level")
                        .HasColumnType("integer");

                    b.Property<long>("RewardDetailId")
                        .HasColumnType("bigint");

                    b.Property<int>("RewardNumber")
                        .HasColumnType("integer");

                    b.Property<int>("RewardType")
                        .HasColumnType("integer");

                    b.Property<int>("SeasonId")
                        .HasColumnType("integer");

                    b.Property<int>("Track")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("SeasonId", "Track", "Level")
                        .IsUnique();

                    b.ToTable("BattlePassRewards");
                });

            modelBuilder.Entity("SVSim.Database.Models.BattlePassSeasonEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<bool>("CanPurchase")
                        .HasColumnType("boolean");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTimeOffset>("EndDate")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("MaxLevel")
                        .HasColumnType("integer");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("PriceCrystal")
                        .HasColumnType("integer");

                    b.Property<DateTimeOffset>("StartDate")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.HasIndex("StartDate", "EndDate");

                    b.ToTable("BattlePassSeasons");
                });

            modelBuilder.Entity("SVSim.Database.Models.BattlefieldEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("IsOpen")
                        .HasColumnType("boolean");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("Battlefields");
                });

            modelBuilder.Entity("SVSim.Database.Models.BotRosterEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<int>("AiId")
                        .HasColumnType("integer");

                    b.Property<int>("BattlePoint")
                        .HasColumnType("integer");

                    b.Property<int>("CharaId")
                        .HasColumnType("integer");

                    b.Property<int>("ClassId")
                        .HasColumnType("integer");

                    b.Property<string>("CountryCode")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("DegreeId")
                        .HasColumnType("integer");

                    b.Property<int>("EmblemId")
                        .HasColumnType("integer");

                    b.Property<int>("FieldId")
                        .HasColumnType("integer");

                    b.Property<int>("IsMasterRank")
                        .HasColumnType("integer");

                    b.Property<int>("IsOfficial")
                        .HasColumnType("integer");

                    b.Property<int>("MasterPoint")
                        .HasColumnType("integer");

                    b.Property<int>("Rank")
                        .HasColumnType("integer");

                    b.Property<int>("SleeveId")
                        .HasColumnType("integer");

                    b.Property<string>("UserName")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("BotRoster");
                });

            modelBuilder.Entity("SVSim.Database.Models.BuildDeckProductEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("DeckCode")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<long>("FeaturedCardId")
                        .HasColumnType("bigint");

                    b.Property<int?>("IntroPriceCrystal")
                        .HasColumnType("integer");

                    b.Property<int?>("IntroPriceRupy")
                        .HasColumnType("integer");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("boolean");

                    b.Property<int>("LeaderId")
                        .HasColumnType("integer");

                    b.Property<string>("ProductNameKey")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("PurchaseNumMax")
                        .HasColumnType("integer");

                    b.Property<int?>("RegularPriceCrystal")
                        .HasColumnType("integer");

                    b.Property<int?>("RegularPriceRupy")
                        .HasColumnType("integer");

                    b.Property<int>("SeriesId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("SeriesId");

                    b.ToTable("BuildDeckProducts");
                });

            modelBuilder.Entity("SVSim.Database.Models.BuildDeckSeriesEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("DrumrollPath")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("IntroKey")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("boolean");

                    b.Property<bool>("IsNew")
                        .HasColumnType("boolean");

                    b.Property<string>("NameKey")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("OrderIndex")
                        .HasColumnType("integer");

                    b.Property<string>("TitlePath")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("BuildDeckSeries");
                });

            modelBuilder.Entity("SVSim.Database.Models.CardCosmeticReward", b =>
                {
                    b.Property<long>("CardId")
                        .HasColumnType("bigint");

                    b.Property<int>("Type")
                        .HasColumnType("integer");

                    b.Property<long>("CosmeticId")
                        .HasColumnType("bigint");

                    b.Property<int>("Quantity")
                        .HasColumnType("integer");

                    b.HasKey("CardId", "Type", "CosmeticId");

                    b.HasIndex("CardId");

                    b.ToTable("CardCosmeticRewards");
                });

            modelBuilder.Entity("SVSim.Database.Models.ClassEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("Classes");
                });

            modelBuilder.Entity("SVSim.Database.Models.ClassExpEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("NecessaryExp")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.ToTable("ClassExpCurve");
                });

            modelBuilder.Entity("SVSim.Database.Models.ColosseumConfig", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<string>("CardPoolName")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("ColosseumId")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("ColosseumName")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("DeckFormat")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime>("EndTime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("IsAllCardEnabled")
                        .HasColumnType("integer");

                    b.Property<bool>("IsColosseumPeriod")
                        .HasColumnType("boolean");

                    b.Property<string>("IsDisplayTips")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("IsNormalTwoPick")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<bool>("IsRoundPeriod")
                        .HasColumnType("boolean");

                    b.Property<string>("IsSpecialMode")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("NowRound")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("SalesPeriodInfo")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<DateTime>("StartTime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("TipsId")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("Colosseums");
                });

            modelBuilder.Entity("SVSim.Database.Models.DailyLoginBonusEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<string>("BonusData")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<int>("BonusId")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.ToTable("DailyLoginBonuses");
                });

            modelBuilder.Entity("SVSim.Database.Models.DefaultDeckEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<string>("CardIdArray")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<int>("ClassId")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("DeckName")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("DeckNo")
                        .HasColumnType("integer");

                    b.Property<int>("LeaderSkinId")
                        .HasColumnType("integer");

                    b.Property<long>("SleeveId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.ToTable("DefaultDecks");
                });

            modelBuilder.Entity("SVSim.Database.Models.DegreeEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.ToTable("Degrees");
                });

            modelBuilder.Entity("SVSim.Database.Models.EmblemEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.ToTable("Emblems");
                });

            modelBuilder.Entity("SVSim.Database.Models.FeatureMaintenanceEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<string>("Data")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("FeatureKey")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("FeatureMaintenances");
                });

            modelBuilder.Entity("SVSim.Database.Models.GameConfigSection", b =>
                {
                    b.Property<string>("SectionName")
                        .HasColumnType("text");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("ValueJson")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.HasKey("SectionName");

                    b.ToTable("GameConfigs");
                });

            modelBuilder.Entity("SVSim.Database.Models.HomeDialogEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("BeginTime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("ButtonListJson")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime>("EndTime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("Image")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("Priority")
                        .HasColumnType("integer");

                    b.Property<string>("TitleTextId")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int?>("Type")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.ToTable("HomeDialogEntries");
                });

            modelBuilder.Entity("SVSim.Database.Models.ItemEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("ThumbnailPath")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("Type")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.ToTable("Items");
                });

            modelBuilder.Entity("SVSim.Database.Models.ItemPurchaseCatalogEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("boolean");

                    b.Property<bool>("IsMonthlyReset")
                        .HasColumnType("boolean");

                    b.Property<long>("PurchaseItemId")
                        .HasColumnType("bigint");

                    b.Property<int>("PurchaseItemNum")
                        .HasColumnType("integer");

                    b.Property<int>("PurchaseItemType")
                        .HasColumnType("integer");

                    b.Property<int>("PurchaseLimit")
                        .HasColumnType("integer");

                    b.Property<string>("PurchaseName")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<long>("RequireItemId")
                        .HasColumnType("bigint");

                    b.Property<int>("RequireItemNum")
                        .HasColumnType("integer");

                    b.Property<int>("RequireItemType")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.ToTable("ItemPurchaseCatalog");
                });

            modelBuilder.Entity("SVSim.Database.Models.LeaderSkinEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<int?>("ClassId")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("EmoteId")
                        .HasColumnType("integer");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.HasIndex("ClassId");

                    b.ToTable("LeaderSkins");
                });

            modelBuilder.Entity("SVSim.Database.Models.LeaderSkinShopProductEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<string>("CvNameKey")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("IntroductionKey")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("boolean");

                    b.Property<int>("LeaderSkinId")
                        .HasColumnType("integer");

                    b.Property<string>("ProductNameKey")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("SeriesId")
                        .HasColumnType("integer");

                    b.Property<int?>("SinglePriceCrystal")
                        .HasColumnType("integer");

                    b.Property<int?>("SinglePriceRupy")
                        .HasColumnType("integer");

                    b.Property<int?>("SinglePriceTicket")
                        .HasColumnType("integer");

                    b.Property<long?>("TicketItemId")
                        .HasColumnType("bigint");

                    b.Property<int?>("TicketNumber")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("SeriesId");

                    b.ToTable("LeaderSkinShopProducts");
                });

            modelBuilder.Entity("SVSim.Database.Models.LeaderSkinShopSeriesEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("boolean");

                    b.Property<bool>("IsNew")
                        .HasColumnType("boolean");

                    b.Property<int>("SetCompletionRewardStatus")
                        .HasColumnType("integer");

                    b.Property<int?>("SetPriceCrystal")
                        .HasColumnType("integer");

                    b.Property<int?>("SetPriceRupy")
                        .HasColumnType("integer");

                    b.Property<int?>("SetPriceTicket")
                        .HasColumnType("integer");

                    b.Property<long?>("SetPriceTicketId")
                        .HasColumnType("bigint");

                    b.Property<int>("SetSalesStatus")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.ToTable("LeaderSkinShopSeries");
                });

            modelBuilder.Entity("SVSim.Database.Models.LoadingExclusionCardEntry", b =>
                {
                    b.Property<long>("Id")
                        .HasColumnType("bigint");

                    b.Property<long>("CardId")
                        .HasColumnType("bigint");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.ToTable("LoadingExclusionCards");
                });

            modelBuilder.Entity("SVSim.Database.Models.MaintenanceCardEntry", b =>
                {
                    b.Property<long>("Id")
                        .HasColumnType("bigint");

                    b.Property<long>("CardId")
                        .HasColumnType("bigint");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.ToTable("MaintenanceCards");
                });

            modelBuilder.Entity("SVSim.Database.Models.MasterPointRankingPeriodEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("BeginTime")
                        .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<DateTime>("EndTime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<long>("NecessaryScore")
                        .HasColumnType("bigint");

                    b.Property<int>("PeriodNum")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.ToTable("MasterPointRankingPeriods");
                });

            modelBuilder.Entity("SVSim.Database.Models.MissionCatalogEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<int>("BattlePassPoint")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("DefaultFlag")
                        .HasColumnType("boolean");

                    b.Property<long?>("EndTime")
                        .HasColumnType("bigint");

                    b.Property<int?>("EventArg")
                        .HasColumnType("integer");

                    b.Property<string>("EventType")
                        .HasColumnType("text");

                    b.Property<int>("LotType")
                        .HasColumnType("integer");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("RequireNumber")
                        .HasColumnType("integer");

                    b.Property<long>("RewardDetailId")
                        .HasColumnType("bigint");

                    b.Property<int>("RewardNumber")
                        .HasColumnType("integer");

                    b.Property<int>("RewardType")
                        .HasColumnType("integer");

                    b.Property<long>("StartTime")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("LotType");

                    b.HasIndex("EventType", "EventArg");

                    b.ToTable("MissionCatalog");
                });

            modelBuilder.Entity("SVSim.Database.Models.MyPageBackgroundEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.ToTable("MyPageBackgrounds");
                });

            modelBuilder.Entity("SVSim.Database.Models.MyRotationAbilityEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<int>("AbilityId")
                        .HasColumnType("integer");

                    b.Property<string>("Data")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.ToTable("MyRotationAbilities");
                });

            modelBuilder.Entity("SVSim.Database.Models.MyRotationSettingEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<string>("AbilitiesCsv")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("CardSetIdsCsv")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("ReprintedCardIds")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<string>("RestrictedCardIds")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<int>("RotationId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    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>("IsEnabled")
                        .HasColumnType("boolean");

                    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.PackDrawCardWeightEntry", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

                    b.Property<long>("CardId")
                        .HasColumnType("bigint");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("IsAltArt")
                        .HasColumnType("boolean");

                    b.Property<bool>("IsLeader")
                        .HasColumnType("boolean");

                    b.Property<int>("PackId")
                        .HasColumnType("integer");

                    b.Property<double?>("RatePct")
                        .HasColumnType("double precision");

                    b.Property<int>("Slot")
                        .HasColumnType("integer");

                    b.Property<int>("Tier")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("PackId", "Slot", "Tier");

                    b.ToTable("PackDrawCardWeights");
                });

            modelBuilder.Entity("SVSim.Database.Models.PackDrawConfigEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<double>("AnimationRatePct")
                        .HasColumnType("double precision");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("HasBonusSlot")
                        .HasColumnType("boolean");

                    b.Property<string>("ShortCode")
                        .HasColumnType("text");

                    b.Property<string>("SpecialKind")
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("PackDrawConfigs");
                });

            modelBuilder.Entity("SVSim.Database.Models.PackDrawSlotRateEntry", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("PackId")
                        .HasColumnType("integer");

                    b.Property<double>("RatePct")
                        .HasColumnType("double precision");

                    b.Property<int>("Slot")
                        .HasColumnType("integer");

                    b.Property<int>("Tier")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("PackId", "Slot", "Tier")
                        .IsUnique();

                    b.ToTable("PackDrawSlotRates");
                });

            modelBuilder.Entity("SVSim.Database.Models.PaymentItemEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<int>("ChargeCrystalNum")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime>("EndTime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("FreeCrystalNum")
                        .HasColumnType("integer");

                    b.Property<string>("ImageName")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("IsResaleProduct")
                        .HasColumnType("integer");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<decimal>("Price")
                        .HasColumnType("numeric");

                    b.Property<int>("ProductId")
                        .HasColumnType("integer");

                    b.Property<int>("PurchaseLimit")
                        .HasColumnType("integer");

                    b.Property<int>("RemainingTime")
                        .HasColumnType("integer");

                    b.Property<DateTime?>("ResaleStartDate")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("SpecialShopFlag")
                        .HasColumnType("integer");

                    b.Property<DateTime>("StartTime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<long>("StoreProductId")
                        .HasColumnType("bigint");

                    b.Property<string>("Text")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("PaymentItems");
                });

            modelBuilder.Entity("SVSim.Database.Models.PracticeOpponentEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<int>("AiDeckLevel")
                        .HasColumnType("integer");

                    b.Property<int>("AiLogicLevel")
                        .HasColumnType("integer");

                    b.Property<int>("AiMaxLife")
                        .HasColumnType("integer");

                    b.Property<string>("Battle3dFieldId")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("CharaId")
                        .HasColumnType("integer");

                    b.Property<int>("ClassId")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("DegreeId")
                        .HasColumnType("integer");

                    b.Property<bool>("IsCampaignPractice")
                        .HasColumnType("boolean");

                    b.Property<bool>("IsMaintenance")
                        .HasColumnType("boolean");

                    b.Property<int>("PracticeId")
                        .HasColumnType("integer");

                    b.Property<string>("TextId")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("PracticeOpponents");
                });

            modelBuilder.Entity("SVSim.Database.Models.PreReleaseInfo", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<int>("CardMasterId")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("DefaultCardMasterId")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime>("DisplayEndTime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime>("EndTime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime>("FreeMatchStartTime")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("IsPreRotationFreeMatchTerm")
                        .HasColumnType("boolean");

                    b.Property<string>("LatestReprintedBaseCardIds")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<string>("NextCardSetId")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("PreReleaseCardMasterId")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("PreReleaseId")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("ReprintedBaseCardIds")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<string>("RotationCardSetIdList")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<DateTime>("StartTime")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.ToTable("PreReleaseInfos");
                });

            modelBuilder.Entity("SVSim.Database.Models.PuzzleEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("GroupId")
                        .HasColumnType("integer");

                    b.Property<bool>("IsAdditional")
                        .HasColumnType("boolean");

                    b.Property<bool>("IsPlayable")
                        .HasColumnType("boolean");

                    b.Property<int>("PuzzleDifficulty")
                        .HasColumnType("integer");

                    b.Property<int>("PuzzleId")
                        .HasColumnType("integer");

                    b.Property<string>("ReleaseConditionTextId")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.HasIndex("GroupId");

                    b.ToTable("Puzzles");
                });

            modelBuilder.Entity("SVSim.Database.Models.PuzzleGroupEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<string>("BasicTitleTextId")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("CharaId")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("DifficultyNameListJson")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("PuzzleCharaId")
                        .HasColumnType("integer");

                    b.Property<int>("PuzzleMasterId")
                        .HasColumnType("integer");

                    b.Property<int>("SortType")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.ToTable("PuzzleGroups");
                });

            modelBuilder.Entity("SVSim.Database.Models.PuzzleMissionEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<string>("AchievedMessage")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<long>("CampaignCommenceTime")
                        .HasColumnType("bigint");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("MissionName")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("OrderId")
                        .HasColumnType("integer");

                    b.Property<int>("RequireNumber")
                        .HasColumnType("integer");

                    b.Property<long>("RewardDetailId")
                        .HasColumnType("bigint");

                    b.Property<int>("RewardNumber")
                        .HasColumnType("integer");

                    b.Property<int>("RewardType")
                        .HasColumnType("integer");

                    b.Property<int?>("TargetPuzzleGroupId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.ToTable("PuzzleMissions");
                });

            modelBuilder.Entity("SVSim.Database.Models.RankInfoEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<int>("AccumulateMasterPoint")
                        .HasColumnType("integer");

                    b.Property<int>("AccumulatePoint")
                        .HasColumnType("integer");

                    b.Property<int>("BaseAddBp")
                        .HasColumnType("integer");

                    b.Property<int>("BaseDropBp")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("IsPromotionWar")
                        .HasColumnType("integer");

                    b.Property<double>("LoseBonus")
                        .HasColumnType("double precision");

                    b.Property<int>("LowerLimitPoint")
                        .HasColumnType("integer");

                    b.Property<int>("MatchCount")
                        .HasColumnType("integer");

                    b.Property<int>("MaxLoseBonus")
                        .HasColumnType("integer");

                    b.Property<int>("MaxWinBonus")
                        .HasColumnType("integer");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("NecessaryPoint")
                        .HasColumnType("integer");

                    b.Property<int>("NecessaryWin")
                        .HasColumnType("integer");

                    b.Property<int>("ResetLose")
                        .HasColumnType("integer");

                    b.Property<int>("StreakBonusPt")
                        .HasColumnType("integer");

                    b.Property<double>("WinBonus")
                        .HasColumnType("double precision");

                    b.HasKey("Id");

                    b.ToTable("RankInfo");
                });

            modelBuilder.Entity("SVSim.Database.Models.ReprintedCardEntry", b =>
                {
                    b.Property<long>("Id")
                        .HasColumnType("bigint");

                    b.Property<long>("CardId")
                        .HasColumnType("bigint");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.ToTable("ReprintedCards");
                });

            modelBuilder.Entity("SVSim.Database.Models.SealedConfig", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<int>("CrystalCost")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("DeckUsingNumMin")
                        .HasColumnType("integer");

                    b.Property<int>("Enable")
                        .HasColumnType("integer");

                    b.Property<bool>("IsDeckCodeMaintenance")
                        .HasColumnType("boolean");

                    b.Property<bool>("IsJoin")
                        .HasColumnType("boolean");

                    b.Property<string>("PackInfo")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<int>("RupyCost")
                        .HasColumnType("integer");

                    b.Property<string>("SalesPeriodInfo")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<int>("ScheduleId")
                        .HasColumnType("integer");

                    b.Property<int>("TicketCost")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.ToTable("SealedSeasons");
                });

            modelBuilder.Entity("SVSim.Database.Models.ShadowverseCardEntry", b =>
                {
                    b.Property<long>("Id")
                        .HasColumnType("bigint");

                    b.Property<int?>("Attack")
                        .HasColumnType("integer");

                    b.Property<int?>("ClassId")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int?>("Defense")
                        .HasColumnType("integer");

                    b.Property<bool>("IsFoil")
                        .HasColumnType("boolean");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int?>("PrimaryResourceCost")
                        .HasColumnType("integer");

                    b.Property<int>("Rarity")
                        .HasColumnType("integer");

                    b.Property<int?>("ShadowverseCardSetEntryId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("ClassId");

                    b.HasIndex("ShadowverseCardSetEntryId");

                    b.ToTable("Cards");
                });

            modelBuilder.Entity("SVSim.Database.Models.ShadowverseCardSetEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("IsBasic")
                        .HasColumnType("boolean");

                    b.Property<bool>("IsInRotation")
                        .HasColumnType("boolean");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("CardSets");
                });

            modelBuilder.Entity("SVSim.Database.Models.ShadowverseDeckEntry", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uuid");

                    b.Property<int>("ClassId")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("Format")
                        .HasColumnType("integer");

                    b.Property<int>("LeaderSkinId")
                        .HasColumnType("integer");

                    b.Property<string>("MyRotationId")
                        .HasColumnType("text");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("Number")
                        .HasColumnType("integer");

                    b.Property<bool>("RandomLeaderSkin")
                        .HasColumnType("boolean");

                    b.Property<int>("SleeveId")
                        .HasColumnType("integer");

                    b.Property<long?>("ViewerId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("ClassId");

                    b.HasIndex("LeaderSkinId");

                    b.HasIndex("SleeveId");

                    b.HasIndex("ViewerId");

                    b.ToTable("Decks");
                });

            modelBuilder.Entity("SVSim.Database.Models.SleeveEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.ToTable("Sleeves");
                });

            modelBuilder.Entity("SVSim.Database.Models.SleeveShopProductEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("boolean");

                    b.Property<string>("NameKey")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int?>("PriceCrystal")
                        .HasColumnType("integer");

                    b.Property<int?>("PriceRupy")
                        .HasColumnType("integer");

                    b.Property<int>("SeriesId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("SeriesId");

                    b.ToTable("SleeveShopProducts");
                });

            modelBuilder.Entity("SVSim.Database.Models.SleeveShopSeriesEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("boolean");

                    b.Property<bool>("IsNew")
                        .HasColumnType("boolean");

                    b.HasKey("Id");

                    b.ToTable("SleeveShopSeries");
                });

            modelBuilder.Entity("SVSim.Database.Models.SpecialDeckFormatEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("DeckFormat")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime>("EndTime")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.ToTable("SpecialDeckFormats");
                });

            modelBuilder.Entity("SVSim.Database.Models.SpotCardEntry", b =>
                {
                    b.Property<long>("Id")
                        .HasColumnType("bigint");

                    b.Property<long>("CardId")
                        .HasColumnType("bigint");

                    b.Property<int>("Cost")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("Id");

                    b.ToTable("SpotCards");
                });

            modelBuilder.Entity("SVSim.Database.Models.SpotCardExchangeEntry", b =>
                {
                    b.Property<long>("Id")
                        .HasColumnType("bigint");

                    b.Property<long>("CardId")
                        .HasColumnType("bigint");

                    b.Property<int>("ClassId")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("ExchangePoint")
                        .HasColumnType("integer");

                    b.Property<bool>("IsEnabled")
                        .HasColumnType("boolean");

                    b.Property<bool>("IsPreRelease")
                        .HasColumnType("boolean");

                    b.Property<long>("TsRotationId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.ToTable("SpotCardExchangeCatalog");
                });

            modelBuilder.Entity("SVSim.Database.Models.StoryDeckEntry", b =>
                {
                    b.Property<int>("Id")
                        .HasColumnType("integer");

                    b.Property<int>("ClassId")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int?>("DeckFormat")
                        .HasColumnType("integer");

                    b.Property<string>("DeckName")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<int>("DeckNo")
                        .HasColumnType("integer");

                    b.Property<int>("EntryNo")
                        .HasColumnType("integer");

                    b.Property<int>("IsRecommend")
                        .HasColumnType("integer");

                    b.Property<int>("Kind")
                        .HasColumnType("integer");

                    b.Property<int>("LeaderSkinId")
                        .HasColumnType("integer");

                    b.Property<int>("OrderNum")
                        .HasColumnType("integer");

                    b.Property<int>("SleeveId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.ToTable("StoryDecks");
                });

            modelBuilder.Entity("SVSim.Database.Models.UnlimitedRestrictionEntry", b =>
                {
                    b.Property<long>("Id")
                        .HasColumnType("bigint");

                    b.Property<long>("CardId")
                        .HasColumnType("bigint");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("RestrictionValue")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.ToTable("UnlimitedRestrictions");
                });

            modelBuilder.Entity("SVSim.Database.Models.Viewer", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<string>("DisplayName")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<DateTime>("LastLogin")
                        .HasColumnType("timestamp with time zone");

                    b.Property<long>("ShortUdid")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint")
                        .HasDefaultValueSql("nextval('\"ShortUdidSequence\"')");

                    NpgsqlPropertyBuilderExtensions.UseSequence(b.Property<long>("ShortUdid"), "ShortUdidSequence");

                    b.Property<Guid?>("Udid")
                        .HasColumnType("uuid");

                    b.HasKey("Id");

                    b.HasIndex("ShortUdid");

                    b.HasIndex("Udid")
                        .IsUnique();

                    b.ToTable("Viewers");
                });

            modelBuilder.Entity("SVSim.Database.Models.ViewerAchievement", b =>
                {
                    b.Property<long>("ViewerId")
                        .HasColumnType("bigint");

                    b.Property<int>("AchievementType")
                        .HasColumnType("integer");

                    b.Property<int>("AchievementStatus")
                        .HasColumnType("integer");

                    b.Property<int>("Level")
                        .HasColumnType("integer");

                    b.Property<int>("NowAchievedLevel")
                        .HasColumnType("integer");

                    b.Property<int>("ResultAnnounceSawLevel")
                        .HasColumnType("integer");

                    b.HasKey("ViewerId", "AchievementType");

                    b.ToTable("ViewerAchievements");
                });

            modelBuilder.Entity("SVSim.Database.Models.ViewerArenaTwoPickRun", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

                    b.Property<string>("CandidateClassIdsJson")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<int>("ChallengeId")
                        .HasColumnType("integer");

                    b.Property<int>("ClassId")
                        .HasColumnType("integer");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<long>("EntryId")
                        .HasColumnType("bigint");

                    b.Property<bool>("IsRetire")
                        .HasColumnType("boolean");

                    b.Property<bool>("IsSelectCompleted")
                        .HasColumnType("boolean");

                    b.Property<long>("LeaderSkinId")
                        .HasColumnType("bigint");

                    b.Property<int>("LossCount")
                        .HasColumnType("integer");

                    b.Property<int>("MaxBattleCount")
                        .HasColumnType("integer");

                    b.Property<long>("NextCandidateId")
                        .HasColumnType("bigint");

                    b.Property<string>("PendingPickSetsJson")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<string>("ResultListJson")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<int>("RewardScheduleId")
                        .HasColumnType("integer");

                    b.Property<int>("SelectTurn")
                        .HasColumnType("integer");

                    b.Property<string>("SelectedCardIdsJson")
                        .IsRequired()
                        .HasColumnType("jsonb");

                    b.Property<DateTime>("UpdatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<long>("ViewerId")
                        .HasColumnType("bigint");

                    b.Property<int>("WinCount")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("ViewerId")
                        .IsUnique();

                    b.ToTable("ViewerArenaTwoPickRuns");
                });

            modelBuilder.Entity("SVSim.Database.Models.ViewerBattlePassClaimEntry", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

                    b.Property<DateTimeOffset>("ClaimedAt")
                        .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<int>("Level")
                        .HasColumnType("integer");

                    b.Property<int>("SeasonId")
                        .HasColumnType("integer");

                    b.Property<int>("Track")
                        .HasColumnType("integer");

                    b.Property<long>("ViewerId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("ViewerId", "SeasonId");

                    b.HasIndex("ViewerId", "SeasonId", "Track", "Level")
                        .IsUnique();

                    b.ToTable("ViewerBattlePassClaims");
                });

            modelBuilder.Entity("SVSim.Database.Models.ViewerBattlePassProgressEntry", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

                    b.Property<int>("CurrentPoint")
                        .HasColumnType("integer");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("IsPremium")
                        .HasColumnType("boolean");

                    b.Property<int>("SeasonId")
                        .HasColumnType("integer");

                    b.Property<long>("ViewerId")
                        .HasColumnType("bigint");

                    b.Property<DateTimeOffset?>("WeeklyPeriodStart")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("WeeklyPoints")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("ViewerId", "SeasonId")
                        .IsUnique();

                    b.ToTable("ViewerBattlePassProgress");
                });

            modelBuilder.Entity("SVSim.Database.Models.ViewerEventCounter", b =>
                {
                    b.Property<long>("ViewerId")
                        .HasColumnType("bigint");

                    b.Property<string>("EventKey")
                        .HasColumnType("text");

                    b.Property<string>("Period")
                        .HasColumnType("text");

                    b.Property<int>("Count")
                        .HasColumnType("integer");

                    b.HasKey("ViewerId", "EventKey", "Period");

                    b.HasIndex("ViewerId", "Period");

                    b.ToTable("ViewerEventCounters");
                });

            modelBuilder.Entity("SVSim.Database.Models.ViewerLeaderSkinSetClaim", b =>
                {
                    b.Property<long>("ViewerId")
                        .HasColumnType("bigint");

                    b.Property<int>("SeriesId")
                        .HasColumnType("integer");

                    b.Property<DateTime>("ClaimedAt")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("ViewerId", "SeriesId");

                    b.HasIndex("ViewerId");

                    b.ToTable("ViewerLeaderSkinSetClaims");
                });

            modelBuilder.Entity("SVSim.Database.Models.ViewerMission", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

                    b.Property<long>("AssignedAt")
                        .HasColumnType("bigint");

                    b.Property<long?>("ClaimedAt")
                        .HasColumnType("bigint");

                    b.Property<DateTime>("DateCreated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<DateTime?>("DateUpdated")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("MissionCatalogId")
                        .HasColumnType("integer");

                    b.Property<int>("MissionStatus")
                        .HasColumnType("integer");

                    b.Property<int>("Slot")
                        .HasColumnType("integer");

                    b.Property<long>("ViewerId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("ViewerId");

                    b.HasIndex("ViewerId", "Slot")
                        .IsUnique();

                    b.ToTable("ViewerMissions");
                });

            modelBuilder.Entity("SVSim.Database.Models.ViewerPresent", b =>
                {
                    b.Property<long>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("bigint");

                    NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));

                    b.Property<DateTime?>("ClaimedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int>("ConditionNumber")
                        .HasColumnType("integer");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<int?>("ItemType")
                        .HasColumnType("integer");

                    b.Property<string>("Message")
                        .IsRequired()
                        .HasColumnType("text");

                    b.Property<string>("PresentId")
                        .IsRequired()
                        .HasMaxLength(64)
                        .HasColumnType("character varying(64)");

                    b.Property<int>("PresentLimitType")
                        .HasColumnType("integer");

                    b.Property<long>("RewardCount")
                        .HasColumnType("bigint");

                    b.Property<long>("RewardDetailId")
                        .HasColumnType("bigint");

                    b.Property<long>("RewardLimitTime")
                        .HasColumnType("bigint");

                    b.Property<int>("RewardType")
                        .HasColumnType("integer");

                    b.Property<string>("Source")
                        .HasMaxLength(64)
                        .HasColumnType("character varying(64)");

                    b.Property<byte>("Status")
                        .HasColumnType("smallint");

                    b.Property<long>("ViewerId")
                        .HasColumnType("bigint");

                    b.HasKey("Id");

                    b.HasIndex("ViewerId", "PresentId")
                        .IsUnique();

                    b.HasIndex("ViewerId", "Status", "CreatedAt");

                    b.ToTable("ViewerPresents");
                });

            modelBuilder.Entity("SVSim.Database.Models.ViewerPuzzleClear", b =>
                {
                    b.Property<long>("ViewerId")
                        .HasColumnType("bigint");

                    b.Property<int>("PuzzleId")
                        .HasColumnType("integer");

                    b.Property<int>("BestRetryCount")
                        .HasColumnType("integer");

                    b.Property<DateTime>("ClearedAt")
                        .HasColumnType("timestamp with time zone");

                    b.HasKey("ViewerId", "PuzzleId");

                    b.ToTable("ViewerPuzzleClears");
                });

            modelBuilder.Entity("SVSim.Database.Models.ViewerSpotCardExchange", b =>
                {
                    b.Property<long>("ViewerId")
                        .HasColumnType("bigint");

                    b.Property<long>("CardId")
                        .HasColumnType("bigint");

                    b.Property<DateTime>("ExchangedAt")
                        .HasColumnType("timestamp with time zone");

                    b.Property<bool>("IsPreRelease")
                        .HasColumnType("boolean");

                    b.HasKey("ViewerId", "CardId");

                    b.HasIndex("ViewerId");

                    b.ToTable("ViewerSpotCardExchanges");
                });

            modelBuilder.Entity("SleeveEntryViewer", b =>
                {
                    b.Property<int>("SleevesId")
                        .HasColumnType("integer");

                    b.Property<long>("ViewersId")
                        .HasColumnType("bigint");

                    b.HasKey("SleevesId", "ViewersId");

                    b.HasIndex("ViewersId");

                    b.ToTable("SleeveEntryViewer");
                });

            modelBuilder.Entity("DegreeEntryViewer", b =>
                {
                    b.HasOne("SVSim.Database.Models.DegreeEntry", null)
                        .WithMany()
                        .HasForeignKey("DegreesId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("SVSim.Database.Models.Viewer", null)
                        .WithMany()
                        .HasForeignKey("ViewersId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("EmblemEntryViewer", b =>
                {
                    b.HasOne("SVSim.Database.Models.EmblemEntry", null)
                        .WithMany()
                        .HasForeignKey("EmblemsId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("SVSim.Database.Models.Viewer", null)
                        .WithMany()
                        .HasForeignKey("ViewersId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("LeaderSkinEntryViewer", b =>
                {
                    b.HasOne("SVSim.Database.Models.LeaderSkinEntry", null)
                        .WithMany()
                        .HasForeignKey("LeaderSkinsId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("SVSim.Database.Models.Viewer", null)
                        .WithMany()
                        .HasForeignKey("ViewersId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("MyPageBackgroundEntryViewer", b =>
                {
                    b.HasOne("SVSim.Database.Models.MyPageBackgroundEntry", null)
                        .WithMany()
                        .HasForeignKey("MyPageBackgroundsId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("SVSim.Database.Models.Viewer", null)
                        .WithMany()
                        .HasForeignKey("ViewersId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .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.BattlePassRewardEntry", b =>
                {
                    b.HasOne("SVSim.Database.Models.BattlePassSeasonEntry", "Season")
                        .WithMany("Rewards")
                        .HasForeignKey("SeasonId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Season");
                });

            modelBuilder.Entity("SVSim.Database.Models.BuildDeckProductEntry", b =>
                {
                    b.HasOne("SVSim.Database.Models.BuildDeckSeriesEntry", "Series")
                        .WithMany("Products")
                        .HasForeignKey("SeriesId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.OwnsMany("SVSim.Database.Models.BuildDeckProductCardEntry", "Cards", b1 =>
                        {
                            b1.Property<int>("BuildDeckProductEntryId")
                                .HasColumnType("integer");

                            b1.Property<int>("Id")
                                .ValueGeneratedOnAdd()
                                .HasColumnType("integer");

                            NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));

                            b1.Property<long>("CardId")
                                .HasColumnType("bigint");

                            b1.Property<bool>("IsSpot")
                                .HasColumnType("boolean");

                            b1.Property<int>("Number")
                                .HasColumnType("integer");

                            b1.HasKey("BuildDeckProductEntryId", "Id");

                            b1.ToTable("BuildDeckProductCardEntry");

                            b1.WithOwner()
                                .HasForeignKey("BuildDeckProductEntryId");
                        });

                    b.OwnsMany("SVSim.Database.Models.BuildDeckProductRewardEntry", "Rewards", b1 =>
                        {
                            b1.Property<int>("BuildDeckProductEntryId")
                                .HasColumnType("integer");

                            b1.Property<int>("Id")
                                .ValueGeneratedOnAdd()
                                .HasColumnType("integer");

                            NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));

                            b1.Property<int>("MessageId")
                                .HasColumnType("integer");

                            b1.Property<long>("RewardDetailId")
                                .HasColumnType("bigint");

                            b1.Property<int>("RewardIndex")
                                .HasColumnType("integer");

                            b1.Property<int>("RewardNumber")
                                .HasColumnType("integer");

                            b1.Property<int>("RewardType")
                                .HasColumnType("integer");

                            b1.HasKey("BuildDeckProductEntryId", "Id");

                            b1.ToTable("BuildDeckProductRewardEntry");

                            b1.WithOwner()
                                .HasForeignKey("BuildDeckProductEntryId");
                        });

                    b.Navigation("Cards");

                    b.Navigation("Rewards");

                    b.Navigation("Series");
                });

            modelBuilder.Entity("SVSim.Database.Models.BuildDeckSeriesEntry", b =>
                {
                    b.OwnsMany("SVSim.Database.Models.BuildDeckSeriesRewardEntry", "SeriesRewards", b1 =>
                        {
                            b1.Property<int>("BuildDeckSeriesEntryId")
                                .HasColumnType("integer");

                            b1.Property<int>("Id")
                                .ValueGeneratedOnAdd()
                                .HasColumnType("integer");

                            NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));

                            b1.Property<int>("ItemIndex")
                                .HasColumnType("integer");

                            b1.Property<int>("MessageId")
                                .HasColumnType("integer");

                            b1.Property<long>("RewardDetailId")
                                .HasColumnType("bigint");

                            b1.Property<int>("RewardNumber")
                                .HasColumnType("integer");

                            b1.Property<int>("RewardType")
                                .HasColumnType("integer");

                            b1.Property<int>("TierIndex")
                                .HasColumnType("integer");

                            b1.HasKey("BuildDeckSeriesEntryId", "Id");

                            b1.ToTable("BuildDeckSeriesRewardEntry");

                            b1.WithOwner()
                                .HasForeignKey("BuildDeckSeriesEntryId");
                        });

                    b.Navigation("SeriesRewards");
                });

            modelBuilder.Entity("SVSim.Database.Models.CardCosmeticReward", b =>
                {
                    b.HasOne("SVSim.Database.Models.ShadowverseCardEntry", "Card")
                        .WithMany()
                        .HasForeignKey("CardId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Card");
                });

            modelBuilder.Entity("SVSim.Database.Models.LeaderSkinEntry", b =>
                {
                    b.HasOne("SVSim.Database.Models.ClassEntry", "Class")
                        .WithMany("LeaderSkins")
                        .HasForeignKey("ClassId");

                    b.Navigation("Class");
                });

            modelBuilder.Entity("SVSim.Database.Models.LeaderSkinShopProductEntry", b =>
                {
                    b.HasOne("SVSim.Database.Models.LeaderSkinShopSeriesEntry", "Series")
                        .WithMany("Products")
                        .HasForeignKey("SeriesId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.OwnsMany("SVSim.Database.Models.LeaderSkinShopProductRewardEntry", "Rewards", b1 =>
                        {
                            b1.Property<int>("LeaderSkinShopProductEntryId")
                                .HasColumnType("integer");

                            b1.Property<int>("Id")
                                .ValueGeneratedOnAdd()
                                .HasColumnType("integer");

                            NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));

                            b1.Property<int>("OrderIndex")
                                .HasColumnType("integer");

                            b1.Property<long>("RewardDetailId")
                                .HasColumnType("bigint");

                            b1.Property<int>("RewardNumber")
                                .HasColumnType("integer");

                            b1.Property<int>("RewardType")
                                .HasColumnType("integer");

                            b1.HasKey("LeaderSkinShopProductEntryId", "Id");

                            b1.ToTable("LeaderSkinShopProductRewardEntry");

                            b1.WithOwner()
                                .HasForeignKey("LeaderSkinShopProductEntryId");
                        });

                    b.Navigation("Rewards");

                    b.Navigation("Series");
                });

            modelBuilder.Entity("SVSim.Database.Models.LeaderSkinShopSeriesEntry", b =>
                {
                    b.OwnsMany("SVSim.Database.Models.LeaderSkinShopSeriesRewardEntry", "SetCompletionRewards", b1 =>
                        {
                            b1.Property<int>("LeaderSkinShopSeriesEntryId")
                                .HasColumnType("integer");

                            b1.Property<int>("Id")
                                .ValueGeneratedOnAdd()
                                .HasColumnType("integer");

                            NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));

                            b1.Property<int>("OrderIndex")
                                .HasColumnType("integer");

                            b1.Property<long>("RewardDetailId")
                                .HasColumnType("bigint");

                            b1.Property<int>("RewardNumber")
                                .HasColumnType("integer");

                            b1.Property<int>("RewardType")
                                .HasColumnType("integer");

                            b1.HasKey("LeaderSkinShopSeriesEntryId", "Id");

                            b1.ToTable("LeaderSkinShopSeriesRewardEntry");

                            b1.WithOwner()
                                .HasForeignKey("LeaderSkinShopSeriesEntryId");
                        });

                    b.Navigation("SetCompletionRewards");
                });

            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>("DailyFreeGachaCount")
                                .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.PuzzleEntry", b =>
                {
                    b.HasOne("SVSim.Database.Models.PuzzleGroupEntry", "Group")
                        .WithMany("Puzzles")
                        .HasForeignKey("GroupId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Group");
                });

            modelBuilder.Entity("SVSim.Database.Models.ShadowverseCardEntry", b =>
                {
                    b.HasOne("SVSim.Database.Models.ClassEntry", "Class")
                        .WithMany()
                        .HasForeignKey("ClassId");

                    b.HasOne("SVSim.Database.Models.ShadowverseCardSetEntry", null)
                        .WithMany("Cards")
                        .HasForeignKey("ShadowverseCardSetEntryId");

                    b.OwnsOne("SVSim.Database.Models.CardCollectionInfo", "CollectionInfo", b1 =>
                        {
                            b1.Property<long>("ShadowverseCardEntryId")
                                .HasColumnType("bigint");

                            b1.Property<int>("CraftCost")
                                .HasColumnType("integer");

                            b1.Property<int>("DustReward")
                                .HasColumnType("integer");

                            b1.HasKey("ShadowverseCardEntryId");

                            b1.ToTable("Cards");

                            b1.WithOwner()
                                .HasForeignKey("ShadowverseCardEntryId");
                        });

                    b.Navigation("Class");

                    b.Navigation("CollectionInfo");
                });

            modelBuilder.Entity("SVSim.Database.Models.ShadowverseDeckEntry", b =>
                {
                    b.HasOne("SVSim.Database.Models.ClassEntry", "Class")
                        .WithMany()
                        .HasForeignKey("ClassId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("SVSim.Database.Models.LeaderSkinEntry", "LeaderSkin")
                        .WithMany()
                        .HasForeignKey("LeaderSkinId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("SVSim.Database.Models.SleeveEntry", "Sleeve")
                        .WithMany()
                        .HasForeignKey("SleeveId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("SVSim.Database.Models.Viewer", null)
                        .WithMany("Decks")
                        .HasForeignKey("ViewerId");

                    b.OwnsMany("SVSim.Database.Models.DeckCard", "Cards", b1 =>
                        {
                            b1.Property<Guid>("ShadowverseDeckEntryId")
                                .HasColumnType("uuid");

                            b1.Property<int>("Id")
                                .ValueGeneratedOnAdd()
                                .HasColumnType("integer");

                            NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));

                            b1.Property<long>("CardId")
                                .HasColumnType("bigint");

                            b1.Property<int>("Count")
                                .HasColumnType("integer");

                            b1.HasKey("ShadowverseDeckEntryId", "Id");

                            b1.HasIndex("CardId");

                            b1.ToTable("DeckCard");

                            b1.HasOne("SVSim.Database.Models.ShadowverseCardEntry", "Card")
                                .WithMany()
                                .HasForeignKey("CardId")
                                .OnDelete(DeleteBehavior.Cascade)
                                .IsRequired();

                            b1.WithOwner()
                                .HasForeignKey("ShadowverseDeckEntryId");

                            b1.Navigation("Card");
                        });

                    b.Navigation("Cards");

                    b.Navigation("Class");

                    b.Navigation("LeaderSkin");

                    b.Navigation("Sleeve");
                });

            modelBuilder.Entity("SVSim.Database.Models.SleeveShopProductEntry", b =>
                {
                    b.HasOne("SVSim.Database.Models.SleeveShopSeriesEntry", "Series")
                        .WithMany("Products")
                        .HasForeignKey("SeriesId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.OwnsMany("SVSim.Database.Models.SleeveShopProductRewardEntry", "Rewards", b1 =>
                        {
                            b1.Property<int>("SleeveShopProductEntryId")
                                .HasColumnType("integer");

                            b1.Property<int>("Id")
                                .ValueGeneratedOnAdd()
                                .HasColumnType("integer");

                            NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));

                            b1.Property<int>("OrderIndex")
                                .HasColumnType("integer");

                            b1.Property<long>("RewardDetailId")
                                .HasColumnType("bigint");

                            b1.Property<int>("RewardNumber")
                                .HasColumnType("integer");

                            b1.Property<int>("RewardType")
                                .HasColumnType("integer");

                            b1.HasKey("SleeveShopProductEntryId", "Id");

                            b1.ToTable("SleeveShopProductRewardEntry");

                            b1.WithOwner()
                                .HasForeignKey("SleeveShopProductEntryId");
                        });

                    b.Navigation("Rewards");

                    b.Navigation("Series");
                });

            modelBuilder.Entity("SVSim.Database.Models.Viewer", b =>
                {
                    b.OwnsMany("SVSim.Database.Models.OwnedCardEntry", "Cards", b1 =>
                        {
                            b1.Property<long>("ViewerId")
                                .HasColumnType("bigint");

                            b1.Property<int>("Id")
                                .ValueGeneratedOnAdd()
                                .HasColumnType("integer");

                            NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));

                            b1.Property<long>("CardId")
                                .HasColumnType("bigint");

                            b1.Property<int>("Count")
                                .HasColumnType("integer");

                            b1.Property<bool>("IsProtected")
                                .HasColumnType("boolean");

                            b1.HasKey("ViewerId", "Id");

                            b1.HasIndex("CardId");

                            b1.HasIndex("ViewerId", "CardId")
                                .IsUnique();

                            b1.ToTable("OwnedCardEntry");

                            b1.HasOne("SVSim.Database.Models.ShadowverseCardEntry", "Card")
                                .WithMany()
                                .HasForeignKey("CardId")
                                .OnDelete(DeleteBehavior.Cascade)
                                .IsRequired();

                            b1.WithOwner()
                                .HasForeignKey("ViewerId");

                            b1.Navigation("Card");
                        });

                    b.OwnsMany("SVSim.Database.Models.OwnedItemEntry", "Items", b1 =>
                        {
                            b1.Property<long>("ViewerId")
                                .HasColumnType("bigint");

                            b1.Property<int>("Id")
                                .ValueGeneratedOnAdd()
                                .HasColumnType("integer");

                            NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));

                            b1.Property<int>("Count")
                                .HasColumnType("integer");

                            b1.Property<int>("ItemId")
                                .HasColumnType("integer");

                            b1.HasKey("ViewerId", "Id");

                            b1.HasIndex("ItemId");

                            b1.HasIndex("ViewerId", "ItemId")
                                .IsUnique();

                            b1.ToTable("OwnedItemEntry");

                            b1.HasOne("SVSim.Database.Models.ItemEntry", "Item")
                                .WithMany()
                                .HasForeignKey("ItemId")
                                .OnDelete(DeleteBehavior.Cascade)
                                .IsRequired();

                            b1.WithOwner("Viewer")
                                .HasForeignKey("ViewerId");

                            b1.Navigation("Item");

                            b1.Navigation("Viewer");
                        });

                    b.OwnsMany("SVSim.Database.Models.SocialAccountConnection", "SocialAccountConnections", b1 =>
                        {
                            b1.Property<long>("ViewerId")
                                .HasColumnType("bigint");

                            b1.Property<int>("Id")
                                .ValueGeneratedOnAdd()
                                .HasColumnType("integer");

                            NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));

                            b1.Property<decimal>("AccountId")
                                .HasColumnType("numeric(20,0)");

                            b1.Property<int>("AccountType")
                                .HasColumnType("integer");

                            b1.HasKey("ViewerId", "Id");

                            b1.HasIndex("AccountType", "AccountId")
                                .IsUnique();

                            b1.ToTable("SocialAccountConnection");

                            b1.WithOwner("Viewer")
                                .HasForeignKey("ViewerId");

                            b1.Navigation("Viewer");
                        });

                    b.OwnsMany("SVSim.Database.Models.ViewerBuildDeckProductPurchase", "BuildDeckPurchases", b1 =>
                        {
                            b1.Property<long>("ViewerId")
                                .HasColumnType("bigint");

                            b1.Property<int>("Id")
                                .ValueGeneratedOnAdd()
                                .HasColumnType("integer");

                            NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));

                            b1.Property<int>("ProductId")
                                .HasColumnType("integer");

                            b1.Property<int>("PurchaseCount")
                                .HasColumnType("integer");

                            b1.HasKey("ViewerId", "Id");

                            b1.HasIndex("ViewerId", "ProductId")
                                .IsUnique();

                            b1.ToTable("ViewerBuildDeckProductPurchase");

                            b1.WithOwner()
                                .HasForeignKey("ViewerId");
                        });

                    b.OwnsMany("SVSim.Database.Models.ViewerClassData", "Classes", b1 =>
                        {
                            b1.Property<long>("ViewerId")
                                .HasColumnType("bigint");

                            b1.Property<int>("Id")
                                .ValueGeneratedOnAdd()
                                .HasColumnType("integer");

                            NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));

                            b1.Property<int>("ClassId")
                                .HasColumnType("integer");

                            b1.Property<int>("Exp")
                                .HasColumnType("integer");

                            b1.Property<int>("LeaderSkinId")
                                .HasColumnType("integer");

                            b1.Property<int>("Level")
                                .HasColumnType("integer");

                            b1.HasKey("ViewerId", "Id");

                            b1.HasIndex("ClassId");

                            b1.HasIndex("LeaderSkinId");

                            b1.ToTable("ViewerClassData");

                            b1.HasOne("SVSim.Database.Models.ClassEntry", "Class")
                                .WithMany()
                                .HasForeignKey("ClassId")
                                .OnDelete(DeleteBehavior.Cascade)
                                .IsRequired();

                            b1.HasOne("SVSim.Database.Models.LeaderSkinEntry", "LeaderSkin")
                                .WithMany()
                                .HasForeignKey("LeaderSkinId")
                                .OnDelete(DeleteBehavior.Cascade)
                                .IsRequired();

                            b1.WithOwner("Viewer")
                                .HasForeignKey("ViewerId");

                            b1.Navigation("Class");

                            b1.Navigation("LeaderSkin");

                            b1.Navigation("Viewer");
                        });

                    b.OwnsOne("SVSim.Database.Models.ViewerCurrency", "Currency", b1 =>
                        {
                            b1.Property<long>("ViewerId")
                                .HasColumnType("bigint");

                            b1.Property<decimal>("AndroidCrystals")
                                .HasColumnType("numeric(20,0)");

                            b1.Property<decimal>("Crystals")
                                .HasColumnType("numeric(20,0)");

                            b1.Property<decimal>("DmmCrystals")
                                .HasColumnType("numeric(20,0)");

                            b1.Property<decimal>("FreeCrystals")
                                .HasColumnType("numeric(20,0)");

                            b1.Property<decimal>("IosCrystals")
                                .HasColumnType("numeric(20,0)");

                            b1.Property<decimal>("LifeTotalCrystals")
                                .HasColumnType("numeric(20,0)");

                            b1.Property<decimal>("RedEther")
                                .HasColumnType("numeric(20,0)");

                            b1.Property<decimal>("Rupees")
                                .HasColumnType("numeric(20,0)");

                            b1.Property<decimal>("SpotPoints")
                                .HasColumnType("numeric(20,0)");

                            b1.Property<decimal>("SteamCrystals")
                                .HasColumnType("numeric(20,0)");

                            b1.HasKey("ViewerId");

                            b1.ToTable("Viewers");

                            b1.WithOwner()
                                .HasForeignKey("ViewerId");
                        });

                    b.OwnsMany("SVSim.Database.Models.ViewerGachaPointBalance", "GachaPointBalances", b1 =>
                        {
                            b1.Property<long>("ViewerId")
                                .HasColumnType("bigint");

                            b1.Property<int>("Id")
                                .ValueGeneratedOnAdd()
                                .HasColumnType("integer");

                            NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));

                            b1.Property<int>("PackId")
                                .HasColumnType("integer");

                            b1.Property<int>("Points")
                                .HasColumnType("integer");

                            b1.HasKey("ViewerId", "Id");

                            b1.HasIndex("ViewerId", "PackId")
                                .IsUnique();

                            b1.ToTable("ViewerGachaPointBalance");

                            b1.WithOwner()
                                .HasForeignKey("ViewerId");
                        });

                    b.OwnsMany("SVSim.Database.Models.ViewerGachaPointReceived", "GachaPointReceived", b1 =>
                        {
                            b1.Property<long>("ViewerId")
                                .HasColumnType("bigint");

                            b1.Property<int>("Id")
                                .ValueGeneratedOnAdd()
                                .HasColumnType("integer");

                            NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));

                            b1.Property<long>("CardId")
                                .HasColumnType("bigint");

                            b1.Property<int>("PackId")
                                .HasColumnType("integer");

                            b1.Property<DateTime>("ReceivedAt")
                                .HasColumnType("timestamp with time zone");

                            b1.HasKey("ViewerId", "Id");

                            b1.HasIndex("ViewerId", "PackId", "CardId")
                                .IsUnique();

                            b1.ToTable("ViewerGachaPointReceived");

                            b1.WithOwner()
                                .HasForeignKey("ViewerId");
                        });

                    b.OwnsOne("SVSim.Database.Models.ViewerInfo", "Info", b1 =>
                        {
                            b1.Property<long>("ViewerId")
                                .HasColumnType("bigint");

                            b1.Property<DateTime>("BirthDate")
                                .HasColumnType("timestamp with time zone");

                            b1.Property<string>("CountryCode")
                                .IsRequired()
                                .HasColumnType("text");

                            b1.Property<bool>("IsOfficial")
                                .HasColumnType("boolean");

                            b1.Property<bool>("IsOfficialMarkDisplayed")
                                .HasColumnType("boolean");

                            b1.Property<int>("MaxFriends")
                                .HasColumnType("integer");

                            b1.Property<int>("SelectedDegreeId")
                                .HasColumnType("integer");

                            b1.Property<int>("SelectedEmblemId")
                                .HasColumnType("integer");

                            b1.HasKey("ViewerId");

                            b1.HasIndex("SelectedDegreeId");

                            b1.HasIndex("SelectedEmblemId");

                            b1.ToTable("Viewers");

                            b1.HasOne("SVSim.Database.Models.DegreeEntry", "SelectedDegree")
                                .WithMany()
                                .HasForeignKey("SelectedDegreeId")
                                .OnDelete(DeleteBehavior.Cascade)
                                .IsRequired();

                            b1.HasOne("SVSim.Database.Models.EmblemEntry", "SelectedEmblem")
                                .WithMany()
                                .HasForeignKey("SelectedEmblemId")
                                .OnDelete(DeleteBehavior.Cascade)
                                .IsRequired();

                            b1.WithOwner()
                                .HasForeignKey("ViewerId");

                            b1.Navigation("SelectedDegree");

                            b1.Navigation("SelectedEmblem");
                        });

                    b.OwnsOne("SVSim.Database.Models.ViewerMissionData", "MissionData", b1 =>
                        {
                            b1.Property<long>("ViewerId")
                                .HasColumnType("bigint");

                            b1.Property<bool>("HasReceivedPickTwoMission")
                                .HasColumnType("boolean");

                            b1.Property<DateTime>("MissionChangeTime")
                                .HasColumnType("timestamp with time zone");

                            b1.Property<int>("MissionReceiveType")
                                .HasColumnType("integer");

                            b1.Property<int>("TutorialState")
                                .HasColumnType("integer");

                            b1.HasKey("ViewerId");

                            b1.ToTable("Viewers");

                            b1.WithOwner()
                                .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("BuildDeckPurchases");

                    b.Navigation("Cards");

                    b.Navigation("Classes");

                    b.Navigation("Currency")
                        .IsRequired();

                    b.Navigation("GachaPointBalances");

                    b.Navigation("GachaPointReceived");

                    b.Navigation("Info")
                        .IsRequired();

                    b.Navigation("Items");

                    b.Navigation("MissionData")
                        .IsRequired();

                    b.Navigation("PackOpenCounts");

                    b.Navigation("SocialAccountConnections");
                });

            modelBuilder.Entity("SVSim.Database.Models.ViewerAchievement", b =>
                {
                    b.HasOne("SVSim.Database.Models.Viewer", null)
                        .WithMany("Achievements")
                        .HasForeignKey("ViewerId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("SVSim.Database.Models.ViewerEventCounter", b =>
                {
                    b.HasOne("SVSim.Database.Models.Viewer", null)
                        .WithMany("EventCounters")
                        .HasForeignKey("ViewerId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("SVSim.Database.Models.ViewerMission", b =>
                {
                    b.HasOne("SVSim.Database.Models.Viewer", null)
                        .WithMany("Missions")
                        .HasForeignKey("ViewerId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("SVSim.Database.Models.ViewerPresent", b =>
                {
                    b.HasOne("SVSim.Database.Models.Viewer", "Viewer")
                        .WithMany()
                        .HasForeignKey("ViewerId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Viewer");
                });

            modelBuilder.Entity("SleeveEntryViewer", b =>
                {
                    b.HasOne("SVSim.Database.Models.SleeveEntry", null)
                        .WithMany()
                        .HasForeignKey("SleevesId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("SVSim.Database.Models.Viewer", null)
                        .WithMany()
                        .HasForeignKey("ViewersId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("SVSim.Database.Models.BattlePassSeasonEntry", b =>
                {
                    b.Navigation("Rewards");
                });

            modelBuilder.Entity("SVSim.Database.Models.BuildDeckSeriesEntry", b =>
                {
                    b.Navigation("Products");
                });

            modelBuilder.Entity("SVSim.Database.Models.ClassEntry", b =>
                {
                    b.Navigation("LeaderSkins");
                });

            modelBuilder.Entity("SVSim.Database.Models.LeaderSkinShopSeriesEntry", b =>
                {
                    b.Navigation("Products");
                });

            modelBuilder.Entity("SVSim.Database.Models.PuzzleGroupEntry", b =>
                {
                    b.Navigation("Puzzles");
                });

            modelBuilder.Entity("SVSim.Database.Models.ShadowverseCardSetEntry", b =>
                {
                    b.Navigation("Cards");
                });

            modelBuilder.Entity("SVSim.Database.Models.SleeveShopSeriesEntry", b =>
                {
                    b.Navigation("Products");
                });

            modelBuilder.Entity("SVSim.Database.Models.Viewer", b =>
                {
                    b.Navigation("Achievements");

                    b.Navigation("Decks");

                    b.Navigation("EventCounters");

                    b.Navigation("Missions");
                });
#pragma warning restore 612, 618
        }
    }
}
