Работа с подклассами

This commit is contained in:
2025-04-25 17:06:10 +04:00
parent a66aa834bd
commit 311a14a39d
15 changed files with 1708 additions and 1601 deletions
@@ -30,7 +30,7 @@ namespace Pf2eModel.Migrations
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_fonts", new[] { "none", "heal", "harm", "any" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "deity_sanctification", new[] { "holy", "unholy", "any" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_rarity", new[] { "common", "uncommon", "rare", "unique" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "unknown", "trait", "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "condition", "deity", "feat", "heritage", "spell", "language" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "entity_type", new[] { "unknown", "trait", "action", "ancestry", "archetype", "background", "backpack", "campaign_feature", "class", "subclass_group", "subclass", "condition", "deity", "feat", "heritage", "spell", "language" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "feat_action_type", new[] { "passive", "action", "reaction", "free" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "feat_category", new[] { "uncategorized", "ancestry-feature", "class-feature", "calling", "class", "skill", "general", "ancestry", "bonus", "deityboon", "curse", "pfsboon", "campaign-feature" });
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "locale_type", new[] { "english", "legacy_english", "russian", "legacy", "hobby", "other" });
@@ -1438,6 +1438,59 @@ namespace Pf2eModel.Migrations
b.ToTable("spell_rituals", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Structure.Subclass", b =>
{
b.Property<int>("Id")
.HasColumnType("integer")
.HasColumnName("id")
.HasColumnOrder(1);
b.Property<string>("Additional")
.IsRequired()
.HasColumnType("jsonb")
.HasColumnName("additional")
.HasColumnOrder(3);
b.Property<string>("Extra")
.IsRequired()
.HasColumnType("text")
.HasColumnName("extra");
b.Property<int>("GroupId")
.HasColumnType("integer")
.HasColumnName("group_id")
.HasColumnOrder(2);
b.HasKey("Id")
.HasName("pk_subclasses");
b.HasIndex("GroupId")
.HasDatabaseName("ix_subclasses_group_id");
b.ToTable("subclasses", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Structure.SubclassGroup", b =>
{
b.Property<int>("Id")
.HasColumnType("integer")
.HasColumnName("id")
.HasColumnOrder(1);
b.Property<int?>("ClassId")
.HasColumnType("integer")
.HasColumnName("class_id")
.HasColumnOrder(2);
b.HasKey("Id")
.HasName("pk_subclass_groups");
b.HasIndex("ClassId")
.HasDatabaseName("ix_subclass_groups_class_id");
b.ToTable("subclass_groups", (string)null);
});
modelBuilder.Entity("Pf2eModel.Model.Structure.Trait", b =>
{
b.Property<int>("Id")
@@ -2001,6 +2054,47 @@ namespace Pf2eModel.Migrations
b.Navigation("Spell");
});
modelBuilder.Entity("Pf2eModel.Model.Structure.Subclass", b =>
{
b.HasOne("Pf2eModel.Model.Structure.SubclassGroup", "Group")
.WithMany("Subclasses")
.HasForeignKey("GroupId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_subclasses_subclass_groups_group_id");
b.HasOne("Pf2eModel.Model.Base.Entity", "Entity")
.WithOne()
.HasForeignKey("Pf2eModel.Model.Structure.Subclass", "Id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_subclasses_entities_id");
b.Navigation("Entity");
b.Navigation("Group");
});
modelBuilder.Entity("Pf2eModel.Model.Structure.SubclassGroup", b =>
{
b.HasOne("Pf2eModel.Model.Structure.Class", "Class")
.WithMany("SubclassGroups")
.HasForeignKey("ClassId")
.OnDelete(DeleteBehavior.Cascade)
.HasConstraintName("fk_subclass_groups_classes_class_id");
b.HasOne("Pf2eModel.Model.Base.Entity", "Entity")
.WithOne()
.HasForeignKey("Pf2eModel.Model.Structure.SubclassGroup", "Id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_subclass_groups_entities_id");
b.Navigation("Class");
b.Navigation("Entity");
});
modelBuilder.Entity("Pf2eModel.Model.Structure.Trait", b =>
{
b.HasOne("Pf2eModel.Model.Base.Entity", "Entity")
@@ -2062,6 +2156,8 @@ namespace Pf2eModel.Migrations
b.Navigation("ClassProgressions");
b.Navigation("ClassTrainings");
b.Navigation("SubclassGroups");
});
modelBuilder.Entity("Pf2eModel.Model.Structure.Deity", b =>
@@ -2090,6 +2186,11 @@ namespace Pf2eModel.Migrations
b.Navigation("SpellRitual");
});
modelBuilder.Entity("Pf2eModel.Model.Structure.SubclassGroup", b =>
{
b.Navigation("Subclasses");
});
#pragma warning restore 612, 618
}
}