chaapter dbs but no tuse dyet

This commit is contained in:
rfi
2024-02-25 10:06:28 +07:00
parent ded826adf0
commit 068142914f
4 changed files with 634 additions and 1 deletions

View File

@@ -0,0 +1,363 @@
// <auto-generated />
using System;
using BLHX.Server.Common.Database;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace BLHX.Server.Common.Migrations.Player
{
[DbContext(typeof(PlayerContext))]
[Migration("20240225030459_ChaptersDB")]
partial class ChaptersDB
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "8.0.2")
.HasAnnotation("Proxies:ChangeTracking", false)
.HasAnnotation("Proxies:CheckEquality", false)
.HasAnnotation("Proxies:LazyLoading", true);
modelBuilder.Entity("BLHX.Server.Common.Database.ChapterInfo", b =>
{
b.Property<uint>("Id")
.HasColumnType("INTEGER");
b.Property<uint>("PlayerUid")
.HasColumnType("INTEGER");
b.Property<string>("AiLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("BattleStatistics")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("BuffLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("CellFlagLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("CellLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<uint>("ChapterHp")
.HasColumnType("INTEGER");
b.Property<string>("ChapterStrategyLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<uint>("ContinuousKillCount")
.HasColumnType("INTEGER");
b.Property<string>("EscortLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("ExtraFlagLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("FleetDuties")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("GroupLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<uint>("InitShipCount")
.HasColumnType("INTEGER");
b.Property<bool>("IsSubmarineAutoAttack")
.HasColumnType("INTEGER");
b.Property<uint>("KillCount")
.HasColumnType("INTEGER");
b.Property<uint>("LoopFlag")
.HasColumnType("INTEGER");
b.Property<uint>("ModelActCount")
.HasColumnType("INTEGER");
b.Property<uint>("MoveStepCount")
.HasColumnType("INTEGER");
b.Property<string>("OperationBuffs")
.IsRequired()
.HasColumnType("jsonb");
b.Property<uint>("Round")
.HasColumnType("INTEGER");
b.Property<DateTime>("Time")
.HasColumnType("TEXT");
b.HasKey("Id", "PlayerUid");
b.HasIndex("PlayerUid");
b.ToTable("ChapterInfoes");
});
modelBuilder.Entity("BLHX.Server.Common.Database.Player", b =>
{
b.Property<uint>("Uid")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Adv")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("TEXT")
.HasDefaultValue("");
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT");
b.Property<uint?>("CurrentChapter")
.HasColumnType("INTEGER");
b.Property<string>("DisplayInfo")
.IsRequired()
.HasColumnType("jsonb");
b.Property<uint>("Exp")
.HasColumnType("INTEGER");
b.Property<string>("Fleets")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("jsonb")
.HasDefaultValue("[{\"Id\":1,\"Name\":null,\"ShipLists\":[1,2],\"Commanders\":[]},{\"Id\":2,\"Name\":null,\"ShipLists\":[],\"Commanders\":[]},{\"Id\":11,\"Name\":null,\"ShipLists\":[],\"Commanders\":[]},{\"Id\":12,\"Name\":null,\"ShipLists\":[],\"Commanders\":[]}]");
b.Property<uint>("Level")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("ShipSkins")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("jsonb")
.HasDefaultValue("[]");
b.Property<string>("Token")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Uid");
b.HasIndex("Token")
.IsUnique();
b.ToTable("Players");
});
modelBuilder.Entity("BLHX.Server.Common.Database.PlayerResource", b =>
{
b.Property<uint>("Id")
.HasColumnType("INTEGER");
b.Property<uint>("PlayerUid")
.HasColumnType("INTEGER");
b.Property<uint>("Num")
.HasColumnType("INTEGER");
b.HasKey("Id", "PlayerUid");
b.HasIndex("PlayerUid");
b.ToTable("Resources");
});
modelBuilder.Entity("BLHX.Server.Common.Database.PlayerShip", b =>
{
b.Property<uint>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<uint>("ActivityNpc")
.HasColumnType("INTEGER");
b.Property<uint>("BluePrintFlag")
.HasColumnType("INTEGER");
b.Property<uint>("CommanderId")
.HasColumnType("INTEGER");
b.Property<uint?>("CommonFlag")
.HasColumnType("INTEGER");
b.Property<string>("CoreLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT");
b.Property<uint>("Energy")
.HasColumnType("INTEGER");
b.Property<string>("EquipInfoLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<uint>("Exp")
.HasColumnType("INTEGER");
b.Property<uint>("Intimacy")
.HasColumnType("INTEGER");
b.Property<bool>("IsLocked")
.HasColumnType("INTEGER");
b.Property<DateTime?>("LastChangeName")
.HasColumnType("TEXT");
b.Property<uint>("Level")
.HasColumnType("INTEGER");
b.Property<string>("MetaRepairLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("Name")
.HasColumnType("TEXT");
b.Property<uint>("PlayerUid")
.HasColumnType("INTEGER");
b.Property<uint>("Proficiency")
.HasColumnType("INTEGER");
b.Property<uint>("Propose")
.HasColumnType("INTEGER");
b.Property<string>("SkillIdLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<uint>("SkinId")
.HasColumnType("INTEGER");
b.Property<string>("State")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("StrengthLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<uint>("TemplateId")
.HasColumnType("INTEGER");
b.Property<string>("TransformLists")
.IsRequired()
.HasColumnType("jsonb");
b.HasKey("Id");
b.HasIndex("PlayerUid");
b.ToTable("Ships");
});
modelBuilder.Entity("BLHX.Server.Common.Database.ResourceField", b =>
{
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.Property<uint>("PlayerUid")
.HasColumnType("INTEGER");
b.Property<DateTime>("LastHarvestTime")
.HasColumnType("TEXT");
b.Property<uint>("Level")
.HasColumnType("INTEGER");
b.Property<DateTime>("UpgradeTime")
.HasColumnType("TEXT");
b.HasKey("Type", "PlayerUid");
b.HasIndex("PlayerUid");
b.ToTable("ResourceFields");
});
modelBuilder.Entity("BLHX.Server.Common.Database.ChapterInfo", b =>
{
b.HasOne("BLHX.Server.Common.Database.Player", "Player")
.WithMany("ChapterInfoes")
.HasForeignKey("PlayerUid")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Player");
});
modelBuilder.Entity("BLHX.Server.Common.Database.PlayerResource", b =>
{
b.HasOne("BLHX.Server.Common.Database.Player", "Player")
.WithMany("Resources")
.HasForeignKey("PlayerUid")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Player");
});
modelBuilder.Entity("BLHX.Server.Common.Database.PlayerShip", b =>
{
b.HasOne("BLHX.Server.Common.Database.Player", "Player")
.WithMany("Ships")
.HasForeignKey("PlayerUid")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Player");
});
modelBuilder.Entity("BLHX.Server.Common.Database.ResourceField", b =>
{
b.HasOne("BLHX.Server.Common.Database.Player", "Player")
.WithMany("ResourceFields")
.HasForeignKey("PlayerUid")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Player");
});
modelBuilder.Entity("BLHX.Server.Common.Database.Player", b =>
{
b.Navigation("ChapterInfoes");
b.Navigation("ResourceFields");
b.Navigation("Resources");
b.Navigation("Ships");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,76 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BLHX.Server.Common.Migrations.Player
{
/// <inheritdoc />
public partial class ChaptersDB : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<uint>(
name: "CurrentChapter",
table: "Players",
type: "INTEGER",
nullable: true);
migrationBuilder.CreateTable(
name: "ChapterInfoes",
columns: table => new
{
Id = table.Column<uint>(type: "INTEGER", nullable: false),
PlayerUid = table.Column<uint>(type: "INTEGER", nullable: false),
Time = table.Column<DateTime>(type: "TEXT", nullable: false),
CellLists = table.Column<string>(type: "jsonb", nullable: false),
GroupLists = table.Column<string>(type: "jsonb", nullable: false),
AiLists = table.Column<string>(type: "jsonb", nullable: false),
EscortLists = table.Column<string>(type: "jsonb", nullable: false),
Round = table.Column<uint>(type: "INTEGER", nullable: false),
IsSubmarineAutoAttack = table.Column<bool>(type: "INTEGER", nullable: false),
OperationBuffs = table.Column<string>(type: "jsonb", nullable: false),
ModelActCount = table.Column<uint>(type: "INTEGER", nullable: false),
BuffLists = table.Column<string>(type: "jsonb", nullable: false),
LoopFlag = table.Column<uint>(type: "INTEGER", nullable: false),
ExtraFlagLists = table.Column<string>(type: "jsonb", nullable: false),
CellFlagLists = table.Column<string>(type: "jsonb", nullable: false),
ChapterHp = table.Column<uint>(type: "INTEGER", nullable: false),
ChapterStrategyLists = table.Column<string>(type: "jsonb", nullable: false),
KillCount = table.Column<uint>(type: "INTEGER", nullable: false),
InitShipCount = table.Column<uint>(type: "INTEGER", nullable: false),
ContinuousKillCount = table.Column<uint>(type: "INTEGER", nullable: false),
BattleStatistics = table.Column<string>(type: "jsonb", nullable: false),
FleetDuties = table.Column<string>(type: "jsonb", nullable: false),
MoveStepCount = table.Column<uint>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ChapterInfoes", x => new { x.Id, x.PlayerUid });
table.ForeignKey(
name: "FK_ChapterInfoes_Players_PlayerUid",
column: x => x.PlayerUid,
principalTable: "Players",
principalColumn: "Uid",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_ChapterInfoes_PlayerUid",
table: "ChapterInfoes",
column: "PlayerUid");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ChapterInfoes");
migrationBuilder.DropColumn(
name: "CurrentChapter",
table: "Players");
}
}
}

View File

@@ -21,6 +21,95 @@ namespace BLHX.Server.Common.Migrations.Player
.HasAnnotation("Proxies:CheckEquality", false)
.HasAnnotation("Proxies:LazyLoading", true);
modelBuilder.Entity("BLHX.Server.Common.Database.ChapterInfo", b =>
{
b.Property<uint>("Id")
.HasColumnType("INTEGER");
b.Property<uint>("PlayerUid")
.HasColumnType("INTEGER");
b.Property<string>("AiLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("BattleStatistics")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("BuffLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("CellFlagLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("CellLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<uint>("ChapterHp")
.HasColumnType("INTEGER");
b.Property<string>("ChapterStrategyLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<uint>("ContinuousKillCount")
.HasColumnType("INTEGER");
b.Property<string>("EscortLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("ExtraFlagLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("FleetDuties")
.IsRequired()
.HasColumnType("jsonb");
b.Property<string>("GroupLists")
.IsRequired()
.HasColumnType("jsonb");
b.Property<uint>("InitShipCount")
.HasColumnType("INTEGER");
b.Property<bool>("IsSubmarineAutoAttack")
.HasColumnType("INTEGER");
b.Property<uint>("KillCount")
.HasColumnType("INTEGER");
b.Property<uint>("LoopFlag")
.HasColumnType("INTEGER");
b.Property<uint>("ModelActCount")
.HasColumnType("INTEGER");
b.Property<uint>("MoveStepCount")
.HasColumnType("INTEGER");
b.Property<string>("OperationBuffs")
.IsRequired()
.HasColumnType("jsonb");
b.Property<uint>("Round")
.HasColumnType("INTEGER");
b.Property<DateTime>("Time")
.HasColumnType("TEXT");
b.HasKey("Id", "PlayerUid");
b.HasIndex("PlayerUid");
b.ToTable("ChapterInfoes");
});
modelBuilder.Entity("BLHX.Server.Common.Database.Player", b =>
{
b.Property<uint>("Uid")
@@ -36,6 +125,9 @@ namespace BLHX.Server.Common.Migrations.Player
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT");
b.Property<uint?>("CurrentChapter")
.HasColumnType("INTEGER");
b.Property<string>("DisplayInfo")
.IsRequired()
.HasColumnType("jsonb");
@@ -208,6 +300,17 @@ namespace BLHX.Server.Common.Migrations.Player
b.ToTable("ResourceFields");
});
modelBuilder.Entity("BLHX.Server.Common.Database.ChapterInfo", b =>
{
b.HasOne("BLHX.Server.Common.Database.Player", "Player")
.WithMany("ChapterInfoes")
.HasForeignKey("PlayerUid")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Player");
});
modelBuilder.Entity("BLHX.Server.Common.Database.PlayerResource", b =>
{
b.HasOne("BLHX.Server.Common.Database.Player", "Player")
@@ -243,6 +346,8 @@ namespace BLHX.Server.Common.Migrations.Player
modelBuilder.Entity("BLHX.Server.Common.Database.Player", b =>
{
b.Navigation("ChapterInfoes");
b.Navigation("ResourceFields");
b.Navigation("Resources");