Отказ от отдельной легаси-сущности

This commit is contained in:
2025-05-15 09:49:57 +04:00
parent 4a7067f0b9
commit afdc5d3f81
21 changed files with 415 additions and 859 deletions
@@ -13,7 +13,7 @@ using Pf2eModel.Model.Enum;
namespace Pf2eModel.Migrations
{
[DbContext(typeof(Pf2eDbContext))]
[Migration("20250514120355_1")]
[Migration("20250515054227_1")]
partial class _1
{
/// <inheritdoc />
@@ -86,25 +86,6 @@ namespace Pf2eModel.Migrations
b.ToTable("entity_keyword", (string)null);
});
modelBuilder.Entity("EntityLegacyEntity", b =>
{
b.Property<int>("LegacyEntitiesId")
.HasColumnType("integer")
.HasColumnName("legacy_entities_id");
b.Property<int>("RemasterEntitiesId")
.HasColumnType("integer")
.HasColumnName("remaster_entities_id");
b.HasKey("LegacyEntitiesId", "RemasterEntitiesId")
.HasName("pk_entity_legacy_entity");
b.HasIndex("RemasterEntitiesId")
.HasDatabaseName("ix_entity_legacy_entity_remaster_entities_id");
b.ToTable("entity_legacy_entity", (string)null);
});
modelBuilder.Entity("EntityTrait", b =>
{
b.Property<int>("EntitiesId")
@@ -194,6 +175,40 @@ namespace Pf2eModel.Migrations
b.ToTable("entities", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Base.EntityAlias", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id")
.HasColumnOrder(1)
.HasComment("Идентификатор");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("EntityId")
.HasColumnType("integer")
.HasColumnName("entity_id")
.HasColumnOrder(2)
.HasComment("Связанная сущность");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)")
.HasColumnName("name")
.HasColumnOrder(3)
.HasComment("Алиас");
b.HasKey("Id")
.HasName("pk_entity_aliases");
b.HasIndex("EntityId")
.HasDatabaseName("ix_entity_aliases_entity_id");
b.ToTable("entity_aliases", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Base.Keywords.Keyword", b =>
{
b.Property<int>("Id")
@@ -259,121 +274,52 @@ namespace Pf2eModel.Migrations
b.ToTable("keyword_aliases", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Base.Legacy.LegacyEntity", b =>
modelBuilder.Entity("Pf2eModel.Model.Base.LegacyRemaster", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
b.Property<int>("LegacyId")
.HasColumnType("integer")
.HasColumnName("id")
.HasColumnOrder(1);
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasColumnType("jsonb")
.HasColumnName("name")
.HasColumnOrder(2)
.HasComment("Отображаемое имя");
b.HasKey("Id")
.HasName("pk_legacy_entities");
b.ToTable("legacy_entities", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Base.Legacy.LegacyEntityExternal", b =>
{
b.Property<int>("LegacyEntityId")
.HasColumnType("integer")
.HasColumnName("legacy_entity_id")
.HasColumnName("legacy_id")
.HasColumnOrder(1)
.HasComment("Идентификатор сущности");
b.Property<int>("TargetId")
b.Property<int>("RemasterId")
.HasColumnType("integer")
.HasColumnName("target_id")
.HasColumnName("remaster_id")
.HasColumnOrder(2)
.HasComment("Идентификатор цели");
b.Property<string>("ExternalId")
.HasMaxLength(255)
.HasColumnType("character varying(255)")
.HasColumnName("external_id")
.HasColumnOrder(3);
b.Property<string>("Md5")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("md5")
.HasColumnOrder(5)
.HasComment("Контрольная сумма объекта");
b.Property<string>("Suffix")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)")
.HasColumnName("suffix")
.HasColumnOrder(4)
.HasComment("Часть URL до объекта. Для источников Foundry - полный UUID объекта");
b.HasKey("LegacyEntityId", "TargetId")
.HasName("pk_legacy_entity_externals");
b.HasIndex("TargetId")
.HasDatabaseName("ix_legacy_entity_externals_target_id");
b.ToTable("legacy_entity_externals", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Base.Legacy.LegacyEntitySource", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
b.Property<int>("LegacyEntitiesId")
.HasColumnType("integer")
.HasColumnName("id")
.HasColumnOrder(0)
.HasComment("Идентификатор");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("IsRemaster")
.HasColumnType("boolean")
.HasColumnName("is_remaster")
.HasColumnOrder(4)
.HasComment("Флаг, указывающий, что объект является частью ремастера");
.HasColumnName("legacy_entities_id");
b.Property<int>("LegacyEntityId")
.HasColumnType("integer")
.HasColumnName("legacy_entity_id")
.HasColumnOrder(1)
.HasComment("Идентификатор устаревшей сущности");
.HasColumnName("legacy_entity_id");
b.Property<int>("SourceId")
b.Property<int>("RemasterEntitiesId")
.HasColumnType("integer")
.HasColumnName("source_id")
.HasColumnOrder(2)
.HasComment("Идентификатор источника");
.HasColumnName("remaster_entities_id");
b.Property<string>("Suffix")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)")
.HasColumnName("suffix")
.HasColumnOrder(3)
.HasComment("Номер страницы, эррата и т.д.");
b.Property<int>("RemasterEntityId")
.HasColumnType("integer")
.HasColumnName("remaster_entity_id");
b.HasKey("Id")
.HasName("pk_legacy_entity_sources");
b.HasKey("LegacyId", "RemasterId")
.HasName("pk_legacy_remasters");
b.HasIndex("LegacyEntitiesId")
.HasDatabaseName("ix_legacy_remasters_legacy_entities_id");
b.HasIndex("LegacyEntityId")
.HasDatabaseName("ix_legacy_entity_sources_legacy_entity_id");
.HasDatabaseName("ix_legacy_remasters_legacy_entity_id");
b.HasIndex("SourceId")
.HasDatabaseName("ix_legacy_entity_sources_source_id");
b.HasIndex("RemasterEntitiesId")
.HasDatabaseName("ix_legacy_remasters_remaster_entities_id");
b.ToTable("legacy_entity_sources", (string)null);
b.HasIndex("RemasterEntityId")
.HasDatabaseName("ix_legacy_remasters_remaster_entity_id");
b.ToTable("legacy_remasters", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Base.Source.EntitySource", b =>
@@ -1984,23 +1930,6 @@ namespace Pf2eModel.Migrations
.HasConstraintName("fk_entity_keyword_keywords_keywords_id");
});
modelBuilder.Entity("EntityLegacyEntity", b =>
{
b.HasOne("Pf2eModel.Model.Base.Legacy.LegacyEntity", null)
.WithMany()
.HasForeignKey("LegacyEntitiesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_entity_legacy_entity_legacy_entities_legacy_entities_id");
b.HasOne("Pf2eModel.Model.Base.Entity", null)
.WithMany()
.HasForeignKey("RemasterEntitiesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_entity_legacy_entity_entities_remaster_entities_id");
});
modelBuilder.Entity("EntityTrait", b =>
{
b.HasOne("Pf2eModel.Model.Base.Entity", null)
@@ -2018,6 +1947,18 @@ namespace Pf2eModel.Migrations
.HasConstraintName("fk_entity_trait_traits_traits_id");
});
modelBuilder.Entity("Pf2eModel.Model.Base.EntityAlias", b =>
{
b.HasOne("Pf2eModel.Model.Base.Entity", "Entity")
.WithMany("Aliases")
.HasForeignKey("EntityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_entity_aliases_entities_entity_id");
b.Navigation("Entity");
});
modelBuilder.Entity("Pf2eModel.Model.Base.Keywords.KeywordAlias", b =>
{
b.HasOne("Pf2eModel.Model.Base.Keywords.Keyword", "Keyword")
@@ -2030,46 +1971,39 @@ namespace Pf2eModel.Migrations
b.Navigation("Keyword");
});
modelBuilder.Entity("Pf2eModel.Model.Base.Legacy.LegacyEntityExternal", b =>
modelBuilder.Entity("Pf2eModel.Model.Base.LegacyRemaster", b =>
{
b.HasOne("Pf2eModel.Model.Base.Legacy.LegacyEntity", "LegacyEntity")
.WithMany("Externals")
b.HasOne("Pf2eModel.Model.Base.Entity", null)
.WithMany()
.HasForeignKey("LegacyEntitiesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_legacy_remasters_entities_legacy_entities_id");
b.HasOne("Pf2eModel.Model.Base.Entity", "LegacyEntity")
.WithMany()
.HasForeignKey("LegacyEntityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_legacy_entity_externals_legacy_entities_legacy_entity_id");
.HasConstraintName("fk_legacy_remasters_entities_legacy_entity_id");
b.HasOne("Pf2eModel.Model.Base.Targets.ExternalTarget", "Target")
.WithMany("LegacyEntityExternals")
.HasForeignKey("TargetId")
b.HasOne("Pf2eModel.Model.Base.Entity", null)
.WithMany()
.HasForeignKey("RemasterEntitiesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_legacy_entity_externals_external_targets_target_id");
.HasConstraintName("fk_legacy_remasters_entities_remaster_entities_id");
b.HasOne("Pf2eModel.Model.Base.Entity", "RemasterEntity")
.WithMany()
.HasForeignKey("RemasterEntityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_legacy_remasters_entities_remaster_entity_id");
b.Navigation("LegacyEntity");
b.Navigation("Target");
});
modelBuilder.Entity("Pf2eModel.Model.Base.Legacy.LegacyEntitySource", b =>
{
b.HasOne("Pf2eModel.Model.Base.Legacy.LegacyEntity", "LegacyEntity")
.WithMany("Sources")
.HasForeignKey("LegacyEntityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_legacy_entity_sources_legacy_entities_legacy_entity_id");
b.HasOne("Pf2eModel.Model.Base.Source.Source", "Source")
.WithMany("LegacyEntitySources")
.HasForeignKey("SourceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_legacy_entity_sources_sources_source_id");
b.Navigation("LegacyEntity");
b.Navigation("Source");
b.Navigation("RemasterEntity");
});
modelBuilder.Entity("Pf2eModel.Model.Base.Source.EntitySource", b =>
@@ -2700,6 +2634,8 @@ namespace Pf2eModel.Migrations
modelBuilder.Entity("Pf2eModel.Model.Base.Entity", b =>
{
b.Navigation("Aliases");
b.Navigation("Externals");
b.Navigation("Sources");
@@ -2710,25 +2646,14 @@ namespace Pf2eModel.Migrations
b.Navigation("Aliases");
});
modelBuilder.Entity("Pf2eModel.Model.Base.Legacy.LegacyEntity", b =>
{
b.Navigation("Externals");
b.Navigation("Sources");
});
modelBuilder.Entity("Pf2eModel.Model.Base.Source.Source", b =>
{
b.Navigation("EntitySources");
b.Navigation("LegacyEntitySources");
});
modelBuilder.Entity("Pf2eModel.Model.Base.Targets.ExternalTarget", b =>
{
b.Navigation("EntityExternals");
b.Navigation("LegacyEntityExternals");
});
modelBuilder.Entity("Pf2eModel.Model.Structure.Ancestry", b =>
@@ -101,19 +101,6 @@ namespace Pf2eModel.Migrations
table.PrimaryKey("pk_keywords", x => x.id);
});
migrationBuilder.CreateTable(
name: "legacy_entities",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
name = table.Column<string>(type: "jsonb", nullable: false, comment: "Отображаемое имя")
},
constraints: table =>
{
table.PrimaryKey("pk_legacy_entities", x => x.id);
});
migrationBuilder.CreateTable(
name: "sources",
columns: table => new
@@ -261,6 +248,26 @@ namespace Pf2eModel.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "entity_aliases",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
entity_id = table.Column<int>(type: "integer", nullable: false, comment: "Связанная сущность"),
name = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Алиас")
},
constraints: table =>
{
table.PrimaryKey("pk_entity_aliases", x => x.id);
table.ForeignKey(
name: "fk_entity_aliases_entities_entity_id",
column: x => x.entity_id,
principalTable: "entities",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "feats",
columns: table => new
@@ -304,6 +311,46 @@ namespace Pf2eModel.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "legacy_remasters",
columns: table => new
{
legacy_id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор сущности"),
remaster_id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор цели"),
legacy_entity_id = table.Column<int>(type: "integer", nullable: false),
remaster_entity_id = table.Column<int>(type: "integer", nullable: false),
legacy_entities_id = table.Column<int>(type: "integer", nullable: false),
remaster_entities_id = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("pk_legacy_remasters", x => new { x.legacy_id, x.remaster_id });
table.ForeignKey(
name: "fk_legacy_remasters_entities_legacy_entities_id",
column: x => x.legacy_entities_id,
principalTable: "entities",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_legacy_remasters_entities_legacy_entity_id",
column: x => x.legacy_entity_id,
principalTable: "entities",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_legacy_remasters_entities_remaster_entities_id",
column: x => x.remaster_entities_id,
principalTable: "entities",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_legacy_remasters_entities_remaster_entity_id",
column: x => x.remaster_entity_id,
principalTable: "entities",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "rituals",
columns: table => new
@@ -477,57 +524,6 @@ namespace Pf2eModel.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "entity_legacy_entity",
columns: table => new
{
legacy_entities_id = table.Column<int>(type: "integer", nullable: false),
remaster_entities_id = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("pk_entity_legacy_entity", x => new { x.legacy_entities_id, x.remaster_entities_id });
table.ForeignKey(
name: "fk_entity_legacy_entity_entities_remaster_entities_id",
column: x => x.remaster_entities_id,
principalTable: "entities",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_entity_legacy_entity_legacy_entities_legacy_entities_id",
column: x => x.legacy_entities_id,
principalTable: "legacy_entities",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "legacy_entity_externals",
columns: table => new
{
legacy_entity_id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор сущности"),
target_id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор цели"),
external_id = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
suffix = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Часть URL до объекта. Для источников Foundry - полный UUID объекта"),
md5 = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: false, comment: "Контрольная сумма объекта")
},
constraints: table =>
{
table.PrimaryKey("pk_legacy_entity_externals", x => new { x.legacy_entity_id, x.target_id });
table.ForeignKey(
name: "fk_legacy_entity_externals_external_targets_target_id",
column: x => x.target_id,
principalTable: "external_targets",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_legacy_entity_externals_legacy_entities_legacy_entity_id",
column: x => x.legacy_entity_id,
principalTable: "legacy_entities",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "entity_sources",
columns: table => new
@@ -556,34 +552,6 @@ namespace Pf2eModel.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "legacy_entity_sources",
columns: table => new
{
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
legacy_entity_id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор устаревшей сущности"),
source_id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор источника"),
suffix = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Номер страницы, эррата и т.д."),
is_remaster = table.Column<bool>(type: "boolean", nullable: false, comment: "Флаг, указывающий, что объект является частью ремастера")
},
constraints: table =>
{
table.PrimaryKey("pk_legacy_entity_sources", x => x.id);
table.ForeignKey(
name: "fk_legacy_entity_sources_legacy_entities_legacy_entity_id",
column: x => x.legacy_entity_id,
principalTable: "legacy_entities",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "fk_legacy_entity_sources_sources_source_id",
column: x => x.source_id,
principalTable: "sources",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "ancestry_boosts",
columns: table => new
@@ -1343,6 +1311,11 @@ namespace Pf2eModel.Migrations
table: "deity_weapons",
column: "deity_id");
migrationBuilder.CreateIndex(
name: "ix_entity_aliases_entity_id",
table: "entity_aliases",
column: "entity_id");
migrationBuilder.CreateIndex(
name: "ix_entity_externals_target_id",
table: "entity_externals",
@@ -1353,11 +1326,6 @@ namespace Pf2eModel.Migrations
table: "entity_keyword",
column: "keywords_id");
migrationBuilder.CreateIndex(
name: "ix_entity_legacy_entity_remaster_entities_id",
table: "entity_legacy_entity",
column: "remaster_entities_id");
migrationBuilder.CreateIndex(
name: "ix_entity_sources_entity_id",
table: "entity_sources",
@@ -1394,19 +1362,24 @@ namespace Pf2eModel.Migrations
column: "entity_id");
migrationBuilder.CreateIndex(
name: "ix_legacy_entity_externals_target_id",
table: "legacy_entity_externals",
column: "target_id");
name: "ix_legacy_remasters_legacy_entities_id",
table: "legacy_remasters",
column: "legacy_entities_id");
migrationBuilder.CreateIndex(
name: "ix_legacy_entity_sources_legacy_entity_id",
table: "legacy_entity_sources",
name: "ix_legacy_remasters_legacy_entity_id",
table: "legacy_remasters",
column: "legacy_entity_id");
migrationBuilder.CreateIndex(
name: "ix_legacy_entity_sources_source_id",
table: "legacy_entity_sources",
column: "source_id");
name: "ix_legacy_remasters_remaster_entities_id",
table: "legacy_remasters",
column: "remaster_entities_id");
migrationBuilder.CreateIndex(
name: "ix_legacy_remasters_remaster_entity_id",
table: "legacy_remasters",
column: "remaster_entity_id");
migrationBuilder.CreateIndex(
name: "ix_ritual_checks_ritual_id",
@@ -1518,15 +1491,15 @@ namespace Pf2eModel.Migrations
migrationBuilder.DropTable(
name: "deity_weapons");
migrationBuilder.DropTable(
name: "entity_aliases");
migrationBuilder.DropTable(
name: "entity_externals");
migrationBuilder.DropTable(
name: "entity_keyword");
migrationBuilder.DropTable(
name: "entity_legacy_entity");
migrationBuilder.DropTable(
name: "entity_sources");
@@ -1546,10 +1519,7 @@ namespace Pf2eModel.Migrations
name: "keyword_aliases");
migrationBuilder.DropTable(
name: "legacy_entity_externals");
migrationBuilder.DropTable(
name: "legacy_entity_sources");
name: "legacy_remasters");
migrationBuilder.DropTable(
name: "ritual_areas");
@@ -1587,6 +1557,12 @@ namespace Pf2eModel.Migrations
migrationBuilder.DropTable(
name: "deities");
migrationBuilder.DropTable(
name: "external_targets");
migrationBuilder.DropTable(
name: "sources");
migrationBuilder.DropTable(
name: "traits");
@@ -1596,15 +1572,6 @@ namespace Pf2eModel.Migrations
migrationBuilder.DropTable(
name: "keywords");
migrationBuilder.DropTable(
name: "external_targets");
migrationBuilder.DropTable(
name: "legacy_entities");
migrationBuilder.DropTable(
name: "sources");
migrationBuilder.DropTable(
name: "rituals");
@@ -83,25 +83,6 @@ namespace Pf2eModel.Migrations
b.ToTable("entity_keyword", (string)null);
});
modelBuilder.Entity("EntityLegacyEntity", b =>
{
b.Property<int>("LegacyEntitiesId")
.HasColumnType("integer")
.HasColumnName("legacy_entities_id");
b.Property<int>("RemasterEntitiesId")
.HasColumnType("integer")
.HasColumnName("remaster_entities_id");
b.HasKey("LegacyEntitiesId", "RemasterEntitiesId")
.HasName("pk_entity_legacy_entity");
b.HasIndex("RemasterEntitiesId")
.HasDatabaseName("ix_entity_legacy_entity_remaster_entities_id");
b.ToTable("entity_legacy_entity", (string)null);
});
modelBuilder.Entity("EntityTrait", b =>
{
b.Property<int>("EntitiesId")
@@ -191,6 +172,40 @@ namespace Pf2eModel.Migrations
b.ToTable("entities", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Base.EntityAlias", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasColumnName("id")
.HasColumnOrder(1)
.HasComment("Идентификатор");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("EntityId")
.HasColumnType("integer")
.HasColumnName("entity_id")
.HasColumnOrder(2)
.HasComment("Связанная сущность");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)")
.HasColumnName("name")
.HasColumnOrder(3)
.HasComment("Алиас");
b.HasKey("Id")
.HasName("pk_entity_aliases");
b.HasIndex("EntityId")
.HasDatabaseName("ix_entity_aliases_entity_id");
b.ToTable("entity_aliases", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Base.Keywords.Keyword", b =>
{
b.Property<int>("Id")
@@ -256,121 +271,52 @@ namespace Pf2eModel.Migrations
b.ToTable("keyword_aliases", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Base.Legacy.LegacyEntity", b =>
modelBuilder.Entity("Pf2eModel.Model.Base.LegacyRemaster", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
b.Property<int>("LegacyId")
.HasColumnType("integer")
.HasColumnName("id")
.HasColumnOrder(1);
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasColumnType("jsonb")
.HasColumnName("name")
.HasColumnOrder(2)
.HasComment("Отображаемое имя");
b.HasKey("Id")
.HasName("pk_legacy_entities");
b.ToTable("legacy_entities", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Base.Legacy.LegacyEntityExternal", b =>
{
b.Property<int>("LegacyEntityId")
.HasColumnType("integer")
.HasColumnName("legacy_entity_id")
.HasColumnName("legacy_id")
.HasColumnOrder(1)
.HasComment("Идентификатор сущности");
b.Property<int>("TargetId")
b.Property<int>("RemasterId")
.HasColumnType("integer")
.HasColumnName("target_id")
.HasColumnName("remaster_id")
.HasColumnOrder(2)
.HasComment("Идентификатор цели");
b.Property<string>("ExternalId")
.HasMaxLength(255)
.HasColumnType("character varying(255)")
.HasColumnName("external_id")
.HasColumnOrder(3);
b.Property<string>("Md5")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("character varying(32)")
.HasColumnName("md5")
.HasColumnOrder(5)
.HasComment("Контрольная сумма объекта");
b.Property<string>("Suffix")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)")
.HasColumnName("suffix")
.HasColumnOrder(4)
.HasComment("Часть URL до объекта. Для источников Foundry - полный UUID объекта");
b.HasKey("LegacyEntityId", "TargetId")
.HasName("pk_legacy_entity_externals");
b.HasIndex("TargetId")
.HasDatabaseName("ix_legacy_entity_externals_target_id");
b.ToTable("legacy_entity_externals", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Base.Legacy.LegacyEntitySource", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
b.Property<int>("LegacyEntitiesId")
.HasColumnType("integer")
.HasColumnName("id")
.HasColumnOrder(0)
.HasComment("Идентификатор");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("IsRemaster")
.HasColumnType("boolean")
.HasColumnName("is_remaster")
.HasColumnOrder(4)
.HasComment("Флаг, указывающий, что объект является частью ремастера");
.HasColumnName("legacy_entities_id");
b.Property<int>("LegacyEntityId")
.HasColumnType("integer")
.HasColumnName("legacy_entity_id")
.HasColumnOrder(1)
.HasComment("Идентификатор устаревшей сущности");
.HasColumnName("legacy_entity_id");
b.Property<int>("SourceId")
b.Property<int>("RemasterEntitiesId")
.HasColumnType("integer")
.HasColumnName("source_id")
.HasColumnOrder(2)
.HasComment("Идентификатор источника");
.HasColumnName("remaster_entities_id");
b.Property<string>("Suffix")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)")
.HasColumnName("suffix")
.HasColumnOrder(3)
.HasComment("Номер страницы, эррата и т.д.");
b.Property<int>("RemasterEntityId")
.HasColumnType("integer")
.HasColumnName("remaster_entity_id");
b.HasKey("Id")
.HasName("pk_legacy_entity_sources");
b.HasKey("LegacyId", "RemasterId")
.HasName("pk_legacy_remasters");
b.HasIndex("LegacyEntitiesId")
.HasDatabaseName("ix_legacy_remasters_legacy_entities_id");
b.HasIndex("LegacyEntityId")
.HasDatabaseName("ix_legacy_entity_sources_legacy_entity_id");
.HasDatabaseName("ix_legacy_remasters_legacy_entity_id");
b.HasIndex("SourceId")
.HasDatabaseName("ix_legacy_entity_sources_source_id");
b.HasIndex("RemasterEntitiesId")
.HasDatabaseName("ix_legacy_remasters_remaster_entities_id");
b.ToTable("legacy_entity_sources", (string)null);
b.HasIndex("RemasterEntityId")
.HasDatabaseName("ix_legacy_remasters_remaster_entity_id");
b.ToTable("legacy_remasters", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Base.Source.EntitySource", b =>
@@ -1981,23 +1927,6 @@ namespace Pf2eModel.Migrations
.HasConstraintName("fk_entity_keyword_keywords_keywords_id");
});
modelBuilder.Entity("EntityLegacyEntity", b =>
{
b.HasOne("Pf2eModel.Model.Base.Legacy.LegacyEntity", null)
.WithMany()
.HasForeignKey("LegacyEntitiesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_entity_legacy_entity_legacy_entities_legacy_entities_id");
b.HasOne("Pf2eModel.Model.Base.Entity", null)
.WithMany()
.HasForeignKey("RemasterEntitiesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_entity_legacy_entity_entities_remaster_entities_id");
});
modelBuilder.Entity("EntityTrait", b =>
{
b.HasOne("Pf2eModel.Model.Base.Entity", null)
@@ -2015,6 +1944,18 @@ namespace Pf2eModel.Migrations
.HasConstraintName("fk_entity_trait_traits_traits_id");
});
modelBuilder.Entity("Pf2eModel.Model.Base.EntityAlias", b =>
{
b.HasOne("Pf2eModel.Model.Base.Entity", "Entity")
.WithMany("Aliases")
.HasForeignKey("EntityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_entity_aliases_entities_entity_id");
b.Navigation("Entity");
});
modelBuilder.Entity("Pf2eModel.Model.Base.Keywords.KeywordAlias", b =>
{
b.HasOne("Pf2eModel.Model.Base.Keywords.Keyword", "Keyword")
@@ -2027,46 +1968,39 @@ namespace Pf2eModel.Migrations
b.Navigation("Keyword");
});
modelBuilder.Entity("Pf2eModel.Model.Base.Legacy.LegacyEntityExternal", b =>
modelBuilder.Entity("Pf2eModel.Model.Base.LegacyRemaster", b =>
{
b.HasOne("Pf2eModel.Model.Base.Legacy.LegacyEntity", "LegacyEntity")
.WithMany("Externals")
b.HasOne("Pf2eModel.Model.Base.Entity", null)
.WithMany()
.HasForeignKey("LegacyEntitiesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_legacy_remasters_entities_legacy_entities_id");
b.HasOne("Pf2eModel.Model.Base.Entity", "LegacyEntity")
.WithMany()
.HasForeignKey("LegacyEntityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_legacy_entity_externals_legacy_entities_legacy_entity_id");
.HasConstraintName("fk_legacy_remasters_entities_legacy_entity_id");
b.HasOne("Pf2eModel.Model.Base.Targets.ExternalTarget", "Target")
.WithMany("LegacyEntityExternals")
.HasForeignKey("TargetId")
b.HasOne("Pf2eModel.Model.Base.Entity", null)
.WithMany()
.HasForeignKey("RemasterEntitiesId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_legacy_entity_externals_external_targets_target_id");
.HasConstraintName("fk_legacy_remasters_entities_remaster_entities_id");
b.HasOne("Pf2eModel.Model.Base.Entity", "RemasterEntity")
.WithMany()
.HasForeignKey("RemasterEntityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_legacy_remasters_entities_remaster_entity_id");
b.Navigation("LegacyEntity");
b.Navigation("Target");
});
modelBuilder.Entity("Pf2eModel.Model.Base.Legacy.LegacyEntitySource", b =>
{
b.HasOne("Pf2eModel.Model.Base.Legacy.LegacyEntity", "LegacyEntity")
.WithMany("Sources")
.HasForeignKey("LegacyEntityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_legacy_entity_sources_legacy_entities_legacy_entity_id");
b.HasOne("Pf2eModel.Model.Base.Source.Source", "Source")
.WithMany("LegacyEntitySources")
.HasForeignKey("SourceId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_legacy_entity_sources_sources_source_id");
b.Navigation("LegacyEntity");
b.Navigation("Source");
b.Navigation("RemasterEntity");
});
modelBuilder.Entity("Pf2eModel.Model.Base.Source.EntitySource", b =>
@@ -2697,6 +2631,8 @@ namespace Pf2eModel.Migrations
modelBuilder.Entity("Pf2eModel.Model.Base.Entity", b =>
{
b.Navigation("Aliases");
b.Navigation("Externals");
b.Navigation("Sources");
@@ -2707,25 +2643,14 @@ namespace Pf2eModel.Migrations
b.Navigation("Aliases");
});
modelBuilder.Entity("Pf2eModel.Model.Base.Legacy.LegacyEntity", b =>
{
b.Navigation("Externals");
b.Navigation("Sources");
});
modelBuilder.Entity("Pf2eModel.Model.Base.Source.Source", b =>
{
b.Navigation("EntitySources");
b.Navigation("LegacyEntitySources");
});
modelBuilder.Entity("Pf2eModel.Model.Base.Targets.ExternalTarget", b =>
{
b.Navigation("EntityExternals");
b.Navigation("LegacyEntityExternals");
});
modelBuilder.Entity("Pf2eModel.Model.Structure.Ancestry", b =>
+11 -2
View File
@@ -2,7 +2,6 @@
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using Pf2eModel.Model.Base.Keywords;
using Pf2eModel.Model.Base.Legacy;
using Pf2eModel.Model.Base.Source;
using Pf2eModel.Model.Base.Targets;
using Pf2eModel.Model.Common.I18n;
@@ -81,6 +80,11 @@ public class Entity
[Comment("Флаг, указывающий, что сущность был проверен и не требует автоматической перезаписи")]
public bool? IsChecked { get; set; } = false;
/// <summary>
/// Коллекция алиасов
/// </summary>
public ICollection<EntityAlias> Aliases { get; set; } = [];
/// <summary>
/// Коллекция признаков, связанных с сущностью.
/// </summary>
@@ -104,5 +108,10 @@ public class Entity
/// <summary>
/// Коллекция устаревших сущностей.
/// </summary>
public ICollection<LegacyEntity> LegacyEntities { get; set; } = [];
public ICollection<Entity> LegacyEntities { get; set; } = [];
/// <summary>
/// Коллекция обновлённых сущностей.
/// </summary>
public ICollection<Entity> RemasterEntities { get; set; } = [];
}
+37
View File
@@ -0,0 +1,37 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace Pf2eModel.Model.Base;
public class EntityAlias
{
/// <summary>
/// Идентификатор источника.
/// </summary>
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Column(Order = 1)]
[Comment("Идентификатор")]
public int Id { get; set; }
/// <summary>
/// Идентификатор связанной сущности.
/// </summary>
[Column(Order = 2)]
[Comment("Связанная сущность")]
public int EntityId { get; set; }
/// <summary>
/// Отображаемое имя источника.
/// </summary>
[Column(Order = 3)]
[MaxLength(Pf2eDbContext.NameLength)]
[Comment("Алиас")]
public string Name { get; set; } = null!;
/// <summary>
/// Связанная
/// </summary>
public Entity Entity { get; set; } = null!;
}
@@ -1,42 +0,0 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using Pf2eModel.Model.Common.I18n;
namespace Pf2eModel.Model.Base.Legacy;
/// <summary>
/// Информация об устаревшей сущности
/// </summary>
public class LegacyEntity
{
/// <summary>
/// Идентификатор сущности.
/// </summary>
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Column(Order = 1)]
public int Id { get; set; }
/// <summary>
/// Отображаемое имя сущности.
/// </summary>
[Column(Order = 2)]
[Comment("Отображаемое имя")]
public LocaleString Name { get; set; } = [];
/// <summary>
/// Коллекция обновлённых сущностей.
/// </summary>
public ICollection<Entity> RemasterEntities { get; set; } = [];
/// <summary>
/// Коллекция источников, связанных с сущностью.
/// </summary>
public ICollection<LegacyEntitySource> Sources { get; set; } = [];
/// <summary>
/// Коллекция внешних ссылок, связанных с сущностью.
/// </summary>
public ICollection<LegacyEntityExternal> Externals { get; set; } = [];
}
@@ -1,58 +0,0 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using Pf2eModel.Model.Base.Targets;
namespace Pf2eModel.Model.Base.Legacy;
/// <summary>
/// Внешняя ссылка сущности.
/// </summary>
[PrimaryKey(nameof(LegacyEntityId), nameof(TargetId))]
public class LegacyEntityExternal
{
/// <summary>
/// Идентификатор сущности.
/// </summary>
[Column(Order = 1)]
[Comment("Идентификатор сущности")]
public int LegacyEntityId { get; set; }
/// <summary>
/// Идентификатор цели.
/// </summary>
[Column(Order = 2)]
[Comment("Идентификатор цели")]
public int TargetId { get; set; }
[Column(Order = 3)]
[MaxLength(255)]
public string? ExternalId { get; set; } = null;
/// <summary>
/// Конечная часть URL внешней ссылки.
/// Для источников Foundry - полный UUID объекта.
/// </summary>
[Column(Order = 4)]
[MaxLength(255)]
[Comment("Часть URL до объекта. Для источников Foundry - полный UUID объекта")]
public string Suffix { get; set; } = "";
/// <summary>
/// Контрольная сумма объекта.
/// </summary>
[Column(Order = 5)]
[MaxLength(32)]
[Comment("Контрольная сумма объекта")]
public string Md5 { get; set; } = null!;
/// <summary>
/// Сущность, которая ссылается на внешнюю ссылку.
/// </summary>
public LegacyEntity LegacyEntity { get; set; } = null!;
/// <summary>
/// Цель внешней ссылки.
/// </summary>
public ExternalTarget Target { get; set; } = null!;
}
@@ -1,59 +0,0 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace Pf2eModel.Model.Base.Legacy;
/// <summary>
/// Связь между сущностью и источником.
/// </summary>
public class LegacyEntitySource
{
/// <summary>
/// Идентификатор связи.
/// </summary>
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[Column(Order = 0)]
[Comment("Идентификатор")]
public int Id { get; set; }
/// <summary>
/// Идентификатор устаревшей сущности.
/// </summary>
[Column(Order = 1)]
[Comment("Идентификатор устаревшей сущности")]
public int LegacyEntityId { get; set; }
/// <summary>
/// Идентификатор источника.
/// </summary>
[Column(Order = 2)]
[Comment("Идентификатор источника")]
public int SourceId { get; set; }
/// <summary>
/// Дополнительная информация о источнике, например, номер страницы, номер тома и т.д.
/// </summary>
[Column(Order = 3)]
[MaxLength(255)]
[Comment("Номер страницы, эррата и т.д.")]
public string Suffix { get; set; } = null!;
/// <summary>
/// Флаг, указывающий, что объект является частью ремастера.
/// </summary>
[Column(Order = 4)]
[Comment("Флаг, указывающий, что объект является частью ремастера")]
public bool IsRemaster { get; set; }
/// <summary>
/// Сущность, к которой относится источник.
/// </summary>
public LegacyEntity LegacyEntity { get; set; } = null!;
/// <summary>
/// Источник, к которому относится сущность.
/// </summary>
public Source.Source Source { get; set; } = null!;
}
+35
View File
@@ -0,0 +1,35 @@
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace Pf2eModel.Model.Base;
/// <summary>
/// Связь устаревших и обновлённых сущностей
/// </summary>
[PrimaryKey(nameof(LegacyId), nameof(RemasterId))]
public class LegacyRemaster
{
/// <summary>
/// Идентификатор устаревшей сущности.
/// </summary>
[Column(Order = 1)]
[Comment("Идентификатор сущности")]
public int LegacyId { get; set; }
/// <summary>
/// Идентификатор обновлённой сущности.
/// </summary>
[Column(Order = 2)]
[Comment("Идентификатор цели")]
public int RemasterId { get; set; }
/// <summary>
/// Устаревшая сущность.
/// </summary>
public Entity LegacyEntity { get; set; } = null!;
/// <summary>
/// Обновлённая сущность.
/// </summary>
public Entity RemasterEntity { get; set; } = null!;
}
-6
View File
@@ -1,7 +1,6 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using Pf2eModel.Model.Base.Legacy;
using Pf2eModel.Model.Enum;
namespace Pf2eModel.Model.Base.Source;
@@ -46,9 +45,4 @@ public class Source
/// Связанные сущности.
/// </summary>
public ICollection<EntitySource> EntitySources { get; set; } = [];
/// <summary>
/// Связанные сущности.
/// </summary>
public ICollection<LegacyEntitySource> LegacyEntitySources { get; set; } = [];
}
@@ -1,7 +1,6 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
using Pf2eModel.Model.Base.Legacy;
namespace Pf2eModel.Model.Base.Targets;
@@ -47,9 +46,4 @@ public class ExternalTarget
/// Коллекция сущностей, которые ссылаются на эту цель.
/// </summary>
public ICollection<EntityExternal> EntityExternals { get; set; } = [];
/// <summary>
/// Коллекция устаревших сущностей, которые ссылаются на эту цель.
/// </summary>
public ICollection<LegacyEntityExternal> LegacyEntityExternals { get; set; } = [];
}
+3 -6
View File
@@ -3,7 +3,6 @@ using dotenv.net.Utilities;
using Microsoft.EntityFrameworkCore;
using Pf2eModel.Model.Base;
using Pf2eModel.Model.Base.Keywords;
using Pf2eModel.Model.Base.Legacy;
using Pf2eModel.Model.Base.Source;
using Pf2eModel.Model.Base.Targets;
using Pf2eModel.Model.Common;
@@ -78,6 +77,8 @@ public partial class Pf2eDbContext : DbContext
public virtual DbSet<Entity> Entities { get; set; }
public virtual DbSet<EntityAlias> EntityAliases { get; set; }
public virtual DbSet<EntityExternal> EntityExternals { get; set; }
public virtual DbSet<EntitySource> EntitySources { get; set; }
@@ -98,11 +99,7 @@ public partial class Pf2eDbContext : DbContext
public virtual DbSet<Language> Languages { get; set; }
public virtual DbSet<LegacyEntity> LegacyEntities { get; set; }
public virtual DbSet<LegacyEntityExternal> LegacyEntityExternals { get; set; }
public virtual DbSet<LegacyEntitySource> LegacyEntitySources { get; set; }
public virtual DbSet<LegacyRemaster> LegacyRemasters { get; set; }
public virtual DbSet<Ritual> Rituals { get; set; }
+18 -33
View File
@@ -6,7 +6,6 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Pf2eModel.Model;
using Pf2eModel.Model.Base;
using Pf2eModel.Model.Base.Keywords;
using Pf2eModel.Model.Base.Legacy;
using Pf2eModel.Model.Base.Source;
using Pf2eModel.Model.Base.Targets;
using Pf2eModel.Model.Common;
@@ -98,6 +97,13 @@ public partial class Pf2eDbContext
entity.HasMany(e => e.Keywords).WithMany(t => t.Entities);
// EntityAliases
entity
.HasMany(e => e.Aliases)
.WithOne(a => a.Entity)
.HasForeignKey(a => a.EntityId)
.OnDelete(DeleteBehavior.Cascade);
// EntitySource
entity
.HasMany(e => e.Sources)
@@ -111,28 +117,19 @@ public partial class Pf2eDbContext
.WithOne(e => e.Entity)
.HasForeignKey(e => e.EntityId)
.OnDelete(DeleteBehavior.Cascade);
});
// LegacyEntity
modelBuilder.Entity<LegacyEntity>(entity =>
{
BindLocaleString(entity, l => l.Name);
entity.HasMany(l => l.RemasterEntities).WithMany(e => e.LegacyEntities);
// LegacyEntitySource
// LegacyRemaster
entity
.HasMany(e => e.Sources)
.WithOne(e => e.LegacyEntity)
.HasForeignKey(e => e.LegacyEntityId)
.OnDelete(DeleteBehavior.Cascade);
// LegacyEntityExternal
entity
.HasMany(e => e.Externals)
.WithOne(e => e.LegacyEntity)
.HasForeignKey(e => e.LegacyEntityId)
.OnDelete(DeleteBehavior.Cascade);
.HasMany(e => e.LegacyEntities)
.WithMany(e => e.RemasterEntities)
.UsingEntity<LegacyRemaster>(
//l =>
// l.HasOne(lr => lr.LegacyEntity).WithMany().HasForeignKey(lr => lr.LegacyId),
//r =>
// r.HasOne(lr => lr.RemasterEntity)
// .WithMany()
// .HasForeignKey(lr => lr.RemasterId)
);
});
// Source
@@ -146,12 +143,6 @@ public partial class Pf2eDbContext
.HasForeignKey(e => e.SourceId)
.OnDelete(DeleteBehavior.Cascade);
entity
.HasMany(s => s.LegacyEntitySources)
.WithOne(e => e.Source)
.HasForeignKey(e => e.SourceId)
.OnDelete(DeleteBehavior.Cascade);
// + EntitySource
});
modelBuilder.Entity<EntitySource>(entity => { });
@@ -164,12 +155,6 @@ public partial class Pf2eDbContext
.WithOne(e => e.Target)
.HasForeignKey(e => e.TargetId)
.OnDelete(DeleteBehavior.Cascade);
entity
.HasMany(t => t.LegacyEntityExternals)
.WithOne(e => e.Target)
.HasForeignKey(e => e.TargetId)
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity<EntityExternal>(entity => { });