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

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
@@ -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 =>