Ритуалы!
This commit is contained in:
+242
-63
@@ -13,7 +13,7 @@ using Pf2eModel.Model.Enum;
|
||||
namespace Pf2eModel.Migrations
|
||||
{
|
||||
[DbContext(typeof(Pf2eDbContext))]
|
||||
[Migration("20250505211157_1")]
|
||||
[Migration("20250506124313_1")]
|
||||
partial class _1
|
||||
{
|
||||
/// <inheritdoc />
|
||||
@@ -34,7 +34,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", "subclass_group", "subclass", "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", "ritual", "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" });
|
||||
@@ -44,7 +44,7 @@ namespace Pf2eModel.Migrations
|
||||
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_damage_category", new[] { "persistent", "splash" });
|
||||
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_damage_kinds", new[] { "damage", "healing", "any" });
|
||||
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_tradition", new[] { "none", "divine", "occult", "arcane", "primal", "elemental", "all" });
|
||||
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "training_stage", new[] { "untrained", "trained", "expert", "master", "legendary" });
|
||||
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "training_rank", new[] { "untrained", "trained", "expert", "master", "legendary", "mythic" });
|
||||
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "trait_type", new[] { "regular", "class", "tradition" });
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
@@ -708,9 +708,9 @@ namespace Pf2eModel.Migrations
|
||||
.HasColumnName("background_id")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<TrainingStage>("Level")
|
||||
.HasColumnType("training_stage")
|
||||
.HasColumnName("level")
|
||||
b.Property<TrainingRank>("Rank")
|
||||
.HasColumnType("training_rank")
|
||||
.HasColumnName("rank")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.Property<int>("TrainingId")
|
||||
@@ -854,9 +854,9 @@ namespace Pf2eModel.Migrations
|
||||
.HasColumnName("class_id")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<TrainingStage>("Stage")
|
||||
.HasColumnType("training_stage")
|
||||
.HasColumnName("stage")
|
||||
b.Property<TrainingRank>("Rank")
|
||||
.HasColumnType("training_rank")
|
||||
.HasColumnName("rank")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.Property<int?>("TrainingId")
|
||||
@@ -905,9 +905,9 @@ namespace Pf2eModel.Migrations
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<TrainingStage>("Stage")
|
||||
.HasColumnType("training_stage")
|
||||
.HasColumnName("stage")
|
||||
b.Property<TrainingRank>("Rank")
|
||||
.HasColumnType("training_rank")
|
||||
.HasColumnName("rank")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.Property<int>("SubclassId")
|
||||
@@ -1238,6 +1238,163 @@ namespace Pf2eModel.Migrations
|
||||
b.ToTable("languages", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Ritual", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("id")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<int>("CastTime")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("cast_time")
|
||||
.HasColumnOrder(3)
|
||||
.HasComment("Продолжительность ритуала в секундах");
|
||||
|
||||
b.Property<string>("Cost")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("cost")
|
||||
.HasColumnOrder(14);
|
||||
|
||||
b.Property<int>("Duration")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("duration")
|
||||
.HasColumnOrder(4)
|
||||
.HasComment("Время действия эффекта ритуала в секундах");
|
||||
|
||||
b.PrimitiveCollection<int[]>("Elements")
|
||||
.IsRequired()
|
||||
.HasColumnType("integer[]")
|
||||
.HasColumnName("elements")
|
||||
.HasColumnOrder(5);
|
||||
|
||||
b.Property<int>("Level")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("level")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<TrainingRank>("PrimaryCheckRank")
|
||||
.HasColumnType("training_rank")
|
||||
.HasColumnName("primary_check_rank")
|
||||
.HasColumnOrder(7);
|
||||
|
||||
b.Property<string>("PrimaryCheckSuffix")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("primary_check_suffix")
|
||||
.HasColumnOrder(8);
|
||||
|
||||
b.Property<int>("Range")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("range")
|
||||
.HasColumnOrder(6);
|
||||
|
||||
b.Property<string>("RangeString")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("range_string")
|
||||
.HasColumnOrder(12);
|
||||
|
||||
b.Property<string>("Requirement")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("requirement")
|
||||
.HasColumnOrder(15);
|
||||
|
||||
b.Property<int>("SecondaryCasters")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("secondary_casters")
|
||||
.HasColumnOrder(9);
|
||||
|
||||
b.Property<int>("SecondaryCastersMax")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("secondary_casters_max")
|
||||
.HasColumnOrder(10);
|
||||
|
||||
b.Property<string>("SecondaryCastersSuffix")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("secondary_casters_suffix")
|
||||
.HasColumnOrder(11);
|
||||
|
||||
b.Property<string>("Target")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("target")
|
||||
.HasColumnOrder(13);
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_rituals");
|
||||
|
||||
b.ToTable("rituals", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.RitualRelation.RitualArea", b =>
|
||||
{
|
||||
b.Property<int>("RitualId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("ritual_id")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<string>("Details")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("details")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<SpellAreaType>("Type")
|
||||
.HasColumnType("spell_area_type")
|
||||
.HasColumnName("type")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.HasKey("RitualId")
|
||||
.HasName("pk_ritual_areas");
|
||||
|
||||
b.ToTable("ritual_areas", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.RitualRelation.RitualCheck", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("id")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<bool>("IsSecondary")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("is_secondary")
|
||||
.HasColumnOrder(6);
|
||||
|
||||
b.Property<TrainingRank>("Rank")
|
||||
.HasColumnType("training_rank")
|
||||
.HasColumnName("rank")
|
||||
.HasColumnOrder(5);
|
||||
|
||||
b.Property<int>("RitualId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("ritual_id")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<int?>("TrainingId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("training_id")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.Property<string>("TrainingString")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("training_string")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_ritual_checks");
|
||||
|
||||
b.HasIndex("RitualId")
|
||||
.HasDatabaseName("ix_ritual_checks_ritual_id");
|
||||
|
||||
b.HasIndex("TrainingId")
|
||||
.HasDatabaseName("ix_ritual_checks_training_id");
|
||||
|
||||
b.ToTable("ritual_checks", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Spell", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -1248,18 +1405,29 @@ namespace Pf2eModel.Migrations
|
||||
b.Property<ActionEnum>("Actions")
|
||||
.HasColumnType("action_enum")
|
||||
.HasColumnName("actions")
|
||||
.HasColumnOrder(3);
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.Property<string>("Cost")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("cost")
|
||||
.HasColumnOrder(11);
|
||||
|
||||
b.Property<int?>("Duration")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("duration")
|
||||
.HasColumnOrder(4);
|
||||
.HasColumnOrder(5);
|
||||
|
||||
b.PrimitiveCollection<int[]>("Elements")
|
||||
.IsRequired()
|
||||
.HasColumnType("integer[]")
|
||||
.HasColumnName("elements")
|
||||
.HasColumnOrder(8);
|
||||
|
||||
b.Property<bool>("IsFocus")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("is_focus")
|
||||
.HasColumnOrder(5);
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.Property<int>("Level")
|
||||
.HasColumnType("integer")
|
||||
@@ -1271,21 +1439,26 @@ namespace Pf2eModel.Migrations
|
||||
.HasColumnName("range")
|
||||
.HasColumnOrder(6);
|
||||
|
||||
b.Property<string>("Requirement")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("requirement")
|
||||
.HasColumnOrder(12);
|
||||
|
||||
b.Property<string>("Target")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("target")
|
||||
.HasColumnOrder(8);
|
||||
.HasColumnOrder(10);
|
||||
|
||||
b.PrimitiveCollection<SpellTradition[]>("Traditions")
|
||||
.IsRequired()
|
||||
.HasColumnType("spell_tradition[]")
|
||||
.HasColumnName("traditions")
|
||||
.HasColumnOrder(6);
|
||||
.HasColumnOrder(7);
|
||||
|
||||
b.Property<string>("Trigger")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("trigger")
|
||||
.HasColumnOrder(7);
|
||||
.HasColumnOrder(9);
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_spells");
|
||||
@@ -1435,38 +1608,6 @@ namespace Pf2eModel.Migrations
|
||||
b.ToTable("spell_defenses", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.SpellRelation.SpellRitual", b =>
|
||||
{
|
||||
b.Property<int>("SpellId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("spell_id")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<string>("PrimaryCheck")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("character varying(255)")
|
||||
.HasColumnName("primary_check")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<int>("SecondaryCasters")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("secondary_casters")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.Property<string>("SecondaryChecks")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("character varying(255)")
|
||||
.HasColumnName("secondary_checks")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.HasKey("SpellId")
|
||||
.HasName("pk_spell_rituals");
|
||||
|
||||
b.ToTable("spell_rituals", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Subclass", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -2064,6 +2205,50 @@ namespace Pf2eModel.Migrations
|
||||
b.Navigation("Entity");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Ritual", b =>
|
||||
{
|
||||
b.HasOne("Pf2eModel.Model.Base.Entity", "Entity")
|
||||
.WithOne()
|
||||
.HasForeignKey("Pf2eModel.Model.Structure.Ritual", "Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_rituals_entities_id");
|
||||
|
||||
b.Navigation("Entity");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.RitualRelation.RitualArea", b =>
|
||||
{
|
||||
b.HasOne("Pf2eModel.Model.Structure.Ritual", "Ritual")
|
||||
.WithOne("Area")
|
||||
.HasForeignKey("Pf2eModel.Model.Structure.RitualRelation.RitualArea", "RitualId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_ritual_areas_rituals_ritual_id");
|
||||
|
||||
b.Navigation("Ritual");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.RitualRelation.RitualCheck", b =>
|
||||
{
|
||||
b.HasOne("Pf2eModel.Model.Structure.Ritual", "Ritual")
|
||||
.WithMany("Checks")
|
||||
.HasForeignKey("RitualId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_ritual_checks_rituals_ritual_id");
|
||||
|
||||
b.HasOne("Pf2eModel.Model.Common.Training", "Training")
|
||||
.WithMany()
|
||||
.HasForeignKey("TrainingId")
|
||||
.OnDelete(DeleteBehavior.SetNull)
|
||||
.HasConstraintName("fk_ritual_checks_trainings_training_id");
|
||||
|
||||
b.Navigation("Ritual");
|
||||
|
||||
b.Navigation("Training");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Spell", b =>
|
||||
{
|
||||
b.HasOne("Pf2eModel.Model.Base.Entity", "Entity")
|
||||
@@ -2112,17 +2297,6 @@ namespace Pf2eModel.Migrations
|
||||
b.Navigation("Spell");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.SpellRelation.SpellRitual", b =>
|
||||
{
|
||||
b.HasOne("Pf2eModel.Model.Structure.Spell", "Spell")
|
||||
.WithOne("SpellRitual")
|
||||
.HasForeignKey("Pf2eModel.Model.Structure.SpellRelation.SpellRitual", "SpellId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.HasConstraintName("fk_spell_rituals_spells_spell_id");
|
||||
|
||||
b.Navigation("Spell");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Subclass", b =>
|
||||
{
|
||||
b.HasOne("Pf2eModel.Model.Structure.SubclassGroup", "Group")
|
||||
@@ -2245,13 +2419,18 @@ namespace Pf2eModel.Migrations
|
||||
b.Navigation("FeatPrerequisites");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Ritual", b =>
|
||||
{
|
||||
b.Navigation("Area");
|
||||
|
||||
b.Navigation("Checks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Spell", b =>
|
||||
{
|
||||
b.Navigation("SpellAreas");
|
||||
|
||||
b.Navigation("SpellDefenses");
|
||||
|
||||
b.Navigation("SpellRitual");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Subclass", b =>
|
||||
+109
-31
@@ -24,7 +24,7 @@ namespace Pf2eModel.Migrations
|
||||
.Annotation("Npgsql:Enum:deity_fonts", "none,heal,harm,any")
|
||||
.Annotation("Npgsql:Enum:deity_sanctification", "holy,unholy,any")
|
||||
.Annotation("Npgsql:Enum:entity_rarity", "common,uncommon,rare,unique")
|
||||
.Annotation("Npgsql:Enum:entity_type", "unknown,trait,action,ancestry,archetype,background,backpack,campaign_feature,class,subclass_group,subclass,condition,deity,feat,heritage,spell,language")
|
||||
.Annotation("Npgsql:Enum:entity_type", "unknown,trait,action,ancestry,archetype,background,backpack,campaign_feature,class,subclass_group,subclass,condition,deity,feat,heritage,spell,ritual,language")
|
||||
.Annotation("Npgsql:Enum:feat_action_type", "passive,action,reaction,free")
|
||||
.Annotation("Npgsql:Enum:feat_category", "uncategorized,ancestry-feature,class-feature,calling,class,skill,general,ancestry,bonus,deityboon,curse,pfsboon,campaign-feature")
|
||||
.Annotation("Npgsql:Enum:locale_type", "english,legacy_english,russian,legacy,hobby,other")
|
||||
@@ -34,7 +34,7 @@ namespace Pf2eModel.Migrations
|
||||
.Annotation("Npgsql:Enum:spell_damage_category", "persistent,splash")
|
||||
.Annotation("Npgsql:Enum:spell_damage_kinds", "damage,healing,any")
|
||||
.Annotation("Npgsql:Enum:spell_tradition", "none,divine,occult,arcane,primal,elemental,all")
|
||||
.Annotation("Npgsql:Enum:training_stage", "untrained,trained,expert,master,legendary")
|
||||
.Annotation("Npgsql:Enum:training_rank", "untrained,trained,expert,master,legendary,mythic")
|
||||
.Annotation("Npgsql:Enum:trait_type", "regular,class,tradition");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
@@ -293,19 +293,53 @@ namespace Pf2eModel.Migrations
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "rituals",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false),
|
||||
level = table.Column<int>(type: "integer", nullable: false),
|
||||
cast_time = table.Column<int>(type: "integer", nullable: false, comment: "Продолжительность ритуала в секундах"),
|
||||
duration = table.Column<int>(type: "integer", nullable: false, comment: "Время действия эффекта ритуала в секундах"),
|
||||
elements = table.Column<int[]>(type: "integer[]", nullable: false),
|
||||
range = table.Column<int>(type: "integer", nullable: false),
|
||||
primary_check_rank = table.Column<TrainingRank>(type: "training_rank", nullable: false),
|
||||
primary_check_suffix = table.Column<string>(type: "jsonb", nullable: true),
|
||||
secondary_casters = table.Column<int>(type: "integer", nullable: false),
|
||||
secondary_casters_max = table.Column<int>(type: "integer", nullable: false),
|
||||
secondary_casters_suffix = table.Column<string>(type: "jsonb", nullable: true),
|
||||
range_string = table.Column<string>(type: "jsonb", nullable: true),
|
||||
target = table.Column<string>(type: "jsonb", nullable: true),
|
||||
cost = table.Column<string>(type: "jsonb", nullable: true),
|
||||
requirement = table.Column<string>(type: "jsonb", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_rituals", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_rituals_entities_id",
|
||||
column: x => x.id,
|
||||
principalTable: "entities",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "spells",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false),
|
||||
level = table.Column<int>(type: "integer", nullable: false),
|
||||
is_focus = table.Column<bool>(type: "boolean", nullable: false),
|
||||
actions = table.Column<ActionEnum>(type: "action_enum", nullable: false),
|
||||
duration = table.Column<int>(type: "integer", maxLength: 255, nullable: true),
|
||||
is_focus = table.Column<bool>(type: "boolean", nullable: false),
|
||||
traditions = table.Column<SpellTradition[]>(type: "spell_tradition[]", nullable: false),
|
||||
range = table.Column<int>(type: "integer", nullable: false),
|
||||
traditions = table.Column<SpellTradition[]>(type: "spell_tradition[]", nullable: false),
|
||||
elements = table.Column<int[]>(type: "integer[]", nullable: false),
|
||||
trigger = table.Column<string>(type: "jsonb", nullable: true),
|
||||
target = table.Column<string>(type: "jsonb", nullable: true)
|
||||
target = table.Column<string>(type: "jsonb", nullable: true),
|
||||
cost = table.Column<string>(type: "jsonb", nullable: true),
|
||||
requirement = table.Column<string>(type: "jsonb", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -554,7 +588,7 @@ namespace Pf2eModel.Migrations
|
||||
id = table.Column<int>(type: "integer", nullable: false),
|
||||
background_id = table.Column<int>(type: "integer", nullable: false),
|
||||
training_id = table.Column<int>(type: "integer", nullable: false),
|
||||
level = table.Column<TrainingStage>(type: "training_stage", nullable: false)
|
||||
rank = table.Column<TrainingRank>(type: "training_rank", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -629,7 +663,7 @@ namespace Pf2eModel.Migrations
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
class_id = table.Column<int>(type: "integer", nullable: false),
|
||||
training_id = table.Column<int>(type: "integer", nullable: true),
|
||||
stage = table.Column<TrainingStage>(type: "training_stage", nullable: false)
|
||||
rank = table.Column<TrainingRank>(type: "training_rank", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -826,6 +860,54 @@ namespace Pf2eModel.Migrations
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ritual_areas",
|
||||
columns: table => new
|
||||
{
|
||||
ritual_id = table.Column<int>(type: "integer", nullable: false),
|
||||
details = table.Column<string>(type: "jsonb", maxLength: 255, nullable: true),
|
||||
type = table.Column<SpellAreaType>(type: "spell_area_type", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_ritual_areas", x => x.ritual_id);
|
||||
table.ForeignKey(
|
||||
name: "fk_ritual_areas_rituals_ritual_id",
|
||||
column: x => x.ritual_id,
|
||||
principalTable: "rituals",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ritual_checks",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ritual_id = table.Column<int>(type: "integer", nullable: false),
|
||||
training_id = table.Column<int>(type: "integer", nullable: true),
|
||||
training_string = table.Column<string>(type: "jsonb", nullable: true),
|
||||
rank = table.Column<TrainingRank>(type: "training_rank", nullable: false),
|
||||
is_secondary = table.Column<bool>(type: "boolean", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_ritual_checks", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_ritual_checks_rituals_ritual_id",
|
||||
column: x => x.ritual_id,
|
||||
principalTable: "rituals",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "fk_ritual_checks_trainings_training_id",
|
||||
column: x => x.training_id,
|
||||
principalTable: "trainings",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "deity_spells",
|
||||
columns: table => new
|
||||
@@ -922,26 +1004,6 @@ namespace Pf2eModel.Migrations
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "spell_rituals",
|
||||
columns: table => new
|
||||
{
|
||||
spell_id = table.Column<int>(type: "integer", nullable: false),
|
||||
primary_check = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
|
||||
secondary_casters = table.Column<int>(type: "integer", nullable: false),
|
||||
secondary_checks = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_spell_rituals", x => x.spell_id);
|
||||
table.ForeignKey(
|
||||
name: "fk_spell_rituals_spells_spell_id",
|
||||
column: x => x.spell_id,
|
||||
principalTable: "spells",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "entity_trait",
|
||||
columns: table => new
|
||||
@@ -1048,7 +1110,7 @@ namespace Pf2eModel.Migrations
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
subclass_id = table.Column<int>(type: "integer", nullable: false),
|
||||
training_id = table.Column<int>(type: "integer", nullable: false),
|
||||
stage = table.Column<TrainingStage>(type: "training_stage", nullable: false)
|
||||
rank = table.Column<TrainingRank>(type: "training_rank", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -1203,6 +1265,16 @@ namespace Pf2eModel.Migrations
|
||||
table: "languages",
|
||||
column: "entity_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_ritual_checks_ritual_id",
|
||||
table: "ritual_checks",
|
||||
column: "ritual_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_ritual_checks_training_id",
|
||||
table: "ritual_checks",
|
||||
column: "training_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_spell_areas_spell_id",
|
||||
table: "spell_areas",
|
||||
@@ -1322,6 +1394,12 @@ namespace Pf2eModel.Migrations
|
||||
migrationBuilder.DropTable(
|
||||
name: "keyword_aliases");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ritual_areas");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ritual_checks");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "spell_areas");
|
||||
|
||||
@@ -1331,9 +1409,6 @@ namespace Pf2eModel.Migrations
|
||||
migrationBuilder.DropTable(
|
||||
name: "spell_defenses");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "spell_rituals");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "subclass_provided_entities");
|
||||
|
||||
@@ -1367,6 +1442,9 @@ namespace Pf2eModel.Migrations
|
||||
migrationBuilder.DropTable(
|
||||
name: "keywords");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "rituals");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "spells");
|
||||
|
||||
@@ -31,7 +31,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", "subclass_group", "subclass", "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", "ritual", "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" });
|
||||
@@ -41,7 +41,7 @@ namespace Pf2eModel.Migrations
|
||||
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_damage_category", new[] { "persistent", "splash" });
|
||||
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_damage_kinds", new[] { "damage", "healing", "any" });
|
||||
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "spell_tradition", new[] { "none", "divine", "occult", "arcane", "primal", "elemental", "all" });
|
||||
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "training_stage", new[] { "untrained", "trained", "expert", "master", "legendary" });
|
||||
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "training_rank", new[] { "untrained", "trained", "expert", "master", "legendary", "mythic" });
|
||||
NpgsqlModelBuilderExtensions.HasPostgresEnum(modelBuilder, "trait_type", new[] { "regular", "class", "tradition" });
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
@@ -705,9 +705,9 @@ namespace Pf2eModel.Migrations
|
||||
.HasColumnName("background_id")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<TrainingStage>("Level")
|
||||
.HasColumnType("training_stage")
|
||||
.HasColumnName("level")
|
||||
b.Property<TrainingRank>("Rank")
|
||||
.HasColumnType("training_rank")
|
||||
.HasColumnName("rank")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.Property<int>("TrainingId")
|
||||
@@ -851,9 +851,9 @@ namespace Pf2eModel.Migrations
|
||||
.HasColumnName("class_id")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<TrainingStage>("Stage")
|
||||
.HasColumnType("training_stage")
|
||||
.HasColumnName("stage")
|
||||
b.Property<TrainingRank>("Rank")
|
||||
.HasColumnType("training_rank")
|
||||
.HasColumnName("rank")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.Property<int?>("TrainingId")
|
||||
@@ -902,9 +902,9 @@ namespace Pf2eModel.Migrations
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<TrainingStage>("Stage")
|
||||
.HasColumnType("training_stage")
|
||||
.HasColumnName("stage")
|
||||
b.Property<TrainingRank>("Rank")
|
||||
.HasColumnType("training_rank")
|
||||
.HasColumnName("rank")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.Property<int>("SubclassId")
|
||||
@@ -1235,6 +1235,163 @@ namespace Pf2eModel.Migrations
|
||||
b.ToTable("languages", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Ritual", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("id")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<int>("CastTime")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("cast_time")
|
||||
.HasColumnOrder(3)
|
||||
.HasComment("Продолжительность ритуала в секундах");
|
||||
|
||||
b.Property<string>("Cost")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("cost")
|
||||
.HasColumnOrder(14);
|
||||
|
||||
b.Property<int>("Duration")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("duration")
|
||||
.HasColumnOrder(4)
|
||||
.HasComment("Время действия эффекта ритуала в секундах");
|
||||
|
||||
b.PrimitiveCollection<int[]>("Elements")
|
||||
.IsRequired()
|
||||
.HasColumnType("integer[]")
|
||||
.HasColumnName("elements")
|
||||
.HasColumnOrder(5);
|
||||
|
||||
b.Property<int>("Level")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("level")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<TrainingRank>("PrimaryCheckRank")
|
||||
.HasColumnType("training_rank")
|
||||
.HasColumnName("primary_check_rank")
|
||||
.HasColumnOrder(7);
|
||||
|
||||
b.Property<string>("PrimaryCheckSuffix")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("primary_check_suffix")
|
||||
.HasColumnOrder(8);
|
||||
|
||||
b.Property<int>("Range")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("range")
|
||||
.HasColumnOrder(6);
|
||||
|
||||
b.Property<string>("RangeString")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("range_string")
|
||||
.HasColumnOrder(12);
|
||||
|
||||
b.Property<string>("Requirement")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("requirement")
|
||||
.HasColumnOrder(15);
|
||||
|
||||
b.Property<int>("SecondaryCasters")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("secondary_casters")
|
||||
.HasColumnOrder(9);
|
||||
|
||||
b.Property<int>("SecondaryCastersMax")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("secondary_casters_max")
|
||||
.HasColumnOrder(10);
|
||||
|
||||
b.Property<string>("SecondaryCastersSuffix")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("secondary_casters_suffix")
|
||||
.HasColumnOrder(11);
|
||||
|
||||
b.Property<string>("Target")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("target")
|
||||
.HasColumnOrder(13);
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_rituals");
|
||||
|
||||
b.ToTable("rituals", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.RitualRelation.RitualArea", b =>
|
||||
{
|
||||
b.Property<int>("RitualId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("ritual_id")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<string>("Details")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("details")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<SpellAreaType>("Type")
|
||||
.HasColumnType("spell_area_type")
|
||||
.HasColumnName("type")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.HasKey("RitualId")
|
||||
.HasName("pk_ritual_areas");
|
||||
|
||||
b.ToTable("ritual_areas", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.RitualRelation.RitualCheck", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("id")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<bool>("IsSecondary")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("is_secondary")
|
||||
.HasColumnOrder(6);
|
||||
|
||||
b.Property<TrainingRank>("Rank")
|
||||
.HasColumnType("training_rank")
|
||||
.HasColumnName("rank")
|
||||
.HasColumnOrder(5);
|
||||
|
||||
b.Property<int>("RitualId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("ritual_id")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<int?>("TrainingId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("training_id")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.Property<string>("TrainingString")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("training_string")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_ritual_checks");
|
||||
|
||||
b.HasIndex("RitualId")
|
||||
.HasDatabaseName("ix_ritual_checks_ritual_id");
|
||||
|
||||
b.HasIndex("TrainingId")
|
||||
.HasDatabaseName("ix_ritual_checks_training_id");
|
||||
|
||||
b.ToTable("ritual_checks", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Spell", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -1245,18 +1402,29 @@ namespace Pf2eModel.Migrations
|
||||
b.Property<ActionEnum>("Actions")
|
||||
.HasColumnType("action_enum")
|
||||
.HasColumnName("actions")
|
||||
.HasColumnOrder(3);
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.Property<string>("Cost")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("cost")
|
||||
.HasColumnOrder(11);
|
||||
|
||||
b.Property<int?>("Duration")
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("duration")
|
||||
.HasColumnOrder(4);
|
||||
.HasColumnOrder(5);
|
||||
|
||||
b.PrimitiveCollection<int[]>("Elements")
|
||||
.IsRequired()
|
||||
.HasColumnType("integer[]")
|
||||
.HasColumnName("elements")
|
||||
.HasColumnOrder(8);
|
||||
|
||||
b.Property<bool>("IsFocus")
|
||||
.HasColumnType("boolean")
|
||||
.HasColumnName("is_focus")
|
||||
.HasColumnOrder(5);
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.Property<int>("Level")
|
||||
.HasColumnType("integer")
|
||||
@@ -1268,21 +1436,26 @@ namespace Pf2eModel.Migrations
|
||||
.HasColumnName("range")
|
||||
.HasColumnOrder(6);
|
||||
|
||||
b.Property<string>("Requirement")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("requirement")
|
||||
.HasColumnOrder(12);
|
||||
|
||||
b.Property<string>("Target")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("target")
|
||||
.HasColumnOrder(8);
|
||||
.HasColumnOrder(10);
|
||||
|
||||
b.PrimitiveCollection<SpellTradition[]>("Traditions")
|
||||
.IsRequired()
|
||||
.HasColumnType("spell_tradition[]")
|
||||
.HasColumnName("traditions")
|
||||
.HasColumnOrder(6);
|
||||
.HasColumnOrder(7);
|
||||
|
||||
b.Property<string>("Trigger")
|
||||
.HasColumnType("jsonb")
|
||||
.HasColumnName("trigger")
|
||||
.HasColumnOrder(7);
|
||||
.HasColumnOrder(9);
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_spells");
|
||||
@@ -1432,38 +1605,6 @@ namespace Pf2eModel.Migrations
|
||||
b.ToTable("spell_defenses", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.SpellRelation.SpellRitual", b =>
|
||||
{
|
||||
b.Property<int>("SpellId")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("spell_id")
|
||||
.HasColumnOrder(1);
|
||||
|
||||
b.Property<string>("PrimaryCheck")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("character varying(255)")
|
||||
.HasColumnName("primary_check")
|
||||
.HasColumnOrder(2);
|
||||
|
||||
b.Property<int>("SecondaryCasters")
|
||||
.HasColumnType("integer")
|
||||
.HasColumnName("secondary_casters")
|
||||
.HasColumnOrder(3);
|
||||
|
||||
b.Property<string>("SecondaryChecks")
|
||||
.IsRequired()
|
||||
.HasMaxLength(255)
|
||||
.HasColumnType("character varying(255)")
|
||||
.HasColumnName("secondary_checks")
|
||||
.HasColumnOrder(4);
|
||||
|
||||
b.HasKey("SpellId")
|
||||
.HasName("pk_spell_rituals");
|
||||
|
||||
b.ToTable("spell_rituals", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Subclass", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -2061,6 +2202,50 @@ namespace Pf2eModel.Migrations
|
||||
b.Navigation("Entity");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Ritual", b =>
|
||||
{
|
||||
b.HasOne("Pf2eModel.Model.Base.Entity", "Entity")
|
||||
.WithOne()
|
||||
.HasForeignKey("Pf2eModel.Model.Structure.Ritual", "Id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_rituals_entities_id");
|
||||
|
||||
b.Navigation("Entity");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.RitualRelation.RitualArea", b =>
|
||||
{
|
||||
b.HasOne("Pf2eModel.Model.Structure.Ritual", "Ritual")
|
||||
.WithOne("Area")
|
||||
.HasForeignKey("Pf2eModel.Model.Structure.RitualRelation.RitualArea", "RitualId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_ritual_areas_rituals_ritual_id");
|
||||
|
||||
b.Navigation("Ritual");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.RitualRelation.RitualCheck", b =>
|
||||
{
|
||||
b.HasOne("Pf2eModel.Model.Structure.Ritual", "Ritual")
|
||||
.WithMany("Checks")
|
||||
.HasForeignKey("RitualId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired()
|
||||
.HasConstraintName("fk_ritual_checks_rituals_ritual_id");
|
||||
|
||||
b.HasOne("Pf2eModel.Model.Common.Training", "Training")
|
||||
.WithMany()
|
||||
.HasForeignKey("TrainingId")
|
||||
.OnDelete(DeleteBehavior.SetNull)
|
||||
.HasConstraintName("fk_ritual_checks_trainings_training_id");
|
||||
|
||||
b.Navigation("Ritual");
|
||||
|
||||
b.Navigation("Training");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Spell", b =>
|
||||
{
|
||||
b.HasOne("Pf2eModel.Model.Base.Entity", "Entity")
|
||||
@@ -2109,17 +2294,6 @@ namespace Pf2eModel.Migrations
|
||||
b.Navigation("Spell");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.SpellRelation.SpellRitual", b =>
|
||||
{
|
||||
b.HasOne("Pf2eModel.Model.Structure.Spell", "Spell")
|
||||
.WithOne("SpellRitual")
|
||||
.HasForeignKey("Pf2eModel.Model.Structure.SpellRelation.SpellRitual", "SpellId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.HasConstraintName("fk_spell_rituals_spells_spell_id");
|
||||
|
||||
b.Navigation("Spell");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Subclass", b =>
|
||||
{
|
||||
b.HasOne("Pf2eModel.Model.Structure.SubclassGroup", "Group")
|
||||
@@ -2242,13 +2416,18 @@ namespace Pf2eModel.Migrations
|
||||
b.Navigation("FeatPrerequisites");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Ritual", b =>
|
||||
{
|
||||
b.Navigation("Area");
|
||||
|
||||
b.Navigation("Checks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Spell", b =>
|
||||
{
|
||||
b.Navigation("SpellAreas");
|
||||
|
||||
b.Navigation("SpellDefenses");
|
||||
|
||||
b.Navigation("SpellRitual");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Pf2eModel.Model.Structure.Subclass", b =>
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum ElementEnum
|
||||
{
|
||||
[PgName("universal")]
|
||||
Universal,
|
||||
|
||||
[PgName("air")]
|
||||
Air,
|
||||
|
||||
[PgName("water")]
|
||||
Water,
|
||||
|
||||
[PgName("earth")]
|
||||
Earth,
|
||||
|
||||
[PgName("fire")]
|
||||
Fire,
|
||||
|
||||
[PgName("wood")]
|
||||
Wood,
|
||||
|
||||
[PgName("metal")]
|
||||
Metal,
|
||||
}
|
||||
@@ -52,6 +52,9 @@ public enum EntityType
|
||||
[PgName("spell")]
|
||||
Spell,
|
||||
|
||||
[PgName("ritual")]
|
||||
Ritual,
|
||||
|
||||
[PgName("language")]
|
||||
Language,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using NpgsqlTypes;
|
||||
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum TrainingRank
|
||||
{
|
||||
[PgName("untrained")]
|
||||
Untrained,
|
||||
|
||||
[PgName("trained")]
|
||||
Trained,
|
||||
|
||||
[PgName("expert")]
|
||||
Expert,
|
||||
|
||||
[PgName("master")]
|
||||
Master,
|
||||
|
||||
[PgName("legendary")]
|
||||
Legendary,
|
||||
|
||||
[PgName("mythic")]
|
||||
Mythic,
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
namespace Pf2eModel.Model.Enum;
|
||||
|
||||
public enum TrainingStage
|
||||
{
|
||||
Untrained = 0,
|
||||
|
||||
Trained = 1,
|
||||
|
||||
Expert = 2,
|
||||
|
||||
Master = 3,
|
||||
|
||||
Legendary = 4,
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class BackgroundTraining
|
||||
public int TrainingId { get; set; }
|
||||
|
||||
[Column(Order = 4)]
|
||||
public TrainingStage Level { get; set; }
|
||||
public TrainingRank Rank { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public Background Background { get; set; } = null!;
|
||||
|
||||
@@ -20,7 +20,7 @@ public class ClassTraining
|
||||
public int? TrainingId { get; set; }
|
||||
|
||||
[Column(Order = 4)]
|
||||
public TrainingStage Stage { get; set; }
|
||||
public TrainingRank Rank { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public Class Class { get; set; } = null!;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class SubclassTrainings
|
||||
public int TrainingId { get; set; }
|
||||
|
||||
[Column(Order = 4)]
|
||||
public TrainingStage Stage { get; set; } = TrainingStage.Trained;
|
||||
public TrainingRank Rank { get; set; } = TrainingRank.Trained;
|
||||
|
||||
public Subclass Subclass { get; set; } = null!;
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Pf2eModel.Model.Base;
|
||||
using Pf2eModel.Model.Common.I18n;
|
||||
using Pf2eModel.Model.Enum;
|
||||
using Pf2eModel.Model.Structure.RitualRelation;
|
||||
|
||||
namespace Pf2eModel.Model.Structure;
|
||||
|
||||
[EntityOfType(EntityType.Ritual)]
|
||||
public class Ritual : IEntity
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
[Column(Order = 1)]
|
||||
public int Id { get; set; }
|
||||
public Entity Entity { get; set; } = null!;
|
||||
|
||||
[Column(Order = 2)]
|
||||
public int Level { get; set; }
|
||||
|
||||
[Column(Order = 3)]
|
||||
[Comment("Продолжительность ритуала в секундах")]
|
||||
public int CastTime { get; set; }
|
||||
|
||||
[Column(Order = 4)]
|
||||
[Comment("Время действия эффекта ритуала в секундах")]
|
||||
public int Duration { get; set; }
|
||||
|
||||
[Column(Order = 5)]
|
||||
public ElementEnum[] Elements { get; set; } = [];
|
||||
|
||||
[Column(Order = 6)]
|
||||
public int Range { get; set; }
|
||||
|
||||
[Column(Order = 7)]
|
||||
public TrainingRank PrimaryCheckRank { get; set; } = TrainingRank.Trained;
|
||||
|
||||
[Column(Order = 8)]
|
||||
public LocaleString? PrimaryCheckSuffix { get; set; } = null;
|
||||
|
||||
[Column(Order = 9)]
|
||||
public int SecondaryCasters { get; set; } = 0;
|
||||
|
||||
[Column(Order = 10)]
|
||||
public int SecondaryCastersMax { get; set; } = 0;
|
||||
|
||||
[Column(Order = 11)]
|
||||
public LocaleString? SecondaryCastersSuffix { get; set; } = null;
|
||||
|
||||
[Column(Order = 12)]
|
||||
public LocaleString? RangeString { get; set; } = null;
|
||||
|
||||
[Column(Order = 13)]
|
||||
public LocaleString? Target { get; set; } = null;
|
||||
|
||||
[Column(Order = 14)]
|
||||
public LocaleString? Cost { get; set; } = null;
|
||||
|
||||
[Column(Order = 15)]
|
||||
public LocaleString? Requirement { get; set; } = null;
|
||||
|
||||
public virtual RitualArea? Area { get; set; } = null;
|
||||
|
||||
public virtual ICollection<RitualCheck> Checks { get; set; } = [];
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Pf2eModel.Model.Common.I18n;
|
||||
using Pf2eModel.Model.Enum;
|
||||
|
||||
namespace Pf2eModel.Model.Structure.RitualRelation;
|
||||
|
||||
public class RitualArea
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
[Column(Order = 1)]
|
||||
public int RitualId { get; set; }
|
||||
|
||||
[Column(Order = 2)]
|
||||
[MaxLength(255)]
|
||||
public LocaleString? Details { get; set; }
|
||||
|
||||
[Column(Order = 3)]
|
||||
public SpellAreaType Type { get; set; }
|
||||
|
||||
public virtual Ritual Ritual { get; set; } = null!;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Pf2eModel.Model.Common;
|
||||
using Pf2eModel.Model.Common.I18n;
|
||||
using Pf2eModel.Model.Enum;
|
||||
|
||||
namespace Pf2eModel.Model.Structure.RitualRelation;
|
||||
|
||||
public class RitualCheck
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
[Column(Order = 1)]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Column(Order = 2)]
|
||||
public int RitualId { get; set; }
|
||||
|
||||
public Ritual Ritual { get; set; } = null!;
|
||||
|
||||
[Column(Order = 3)]
|
||||
public int? TrainingId { get; set; }
|
||||
|
||||
public Training? Training { get; set; } = null!;
|
||||
|
||||
[Column(Order = 4)]
|
||||
public LocaleString? TrainingString { get; set; } = null;
|
||||
|
||||
[Column(Order = 5)]
|
||||
public TrainingRank Rank { get; set; }
|
||||
|
||||
[Column(Order = 6)]
|
||||
public bool IsSecondary { get; set; }
|
||||
}
|
||||
@@ -21,27 +21,36 @@ public class Spell : IEntity
|
||||
public int Level { get; set; }
|
||||
|
||||
[Column(Order = 3)]
|
||||
public ActionEnum Actions { get; set; } = ActionEnum.Other;
|
||||
|
||||
[Column(Order = 4)]
|
||||
[MaxLength(255)]
|
||||
public int? Duration { get; set; } = null;
|
||||
|
||||
[Column(Order = 5)]
|
||||
public bool IsFocus { get; set; }
|
||||
|
||||
[Column(Order = 6)]
|
||||
public SpellTradition[] Traditions { get; set; } = [];
|
||||
[Column(Order = 4)]
|
||||
public ActionEnum Actions { get; set; } = ActionEnum.Other;
|
||||
|
||||
[Column(Order = 5)]
|
||||
[MaxLength(255)]
|
||||
public int? Duration { get; set; } = null;
|
||||
|
||||
[Column(Order = 6)]
|
||||
public int Range { get; set; }
|
||||
|
||||
[Column(Order = 7)]
|
||||
public LocaleString? Trigger { get; set; } = null;
|
||||
public SpellTradition[] Traditions { get; set; } = [];
|
||||
|
||||
[Column(Order = 8)]
|
||||
public ElementEnum[] Elements { get; set; } = [];
|
||||
|
||||
[Column(Order = 9)]
|
||||
public LocaleString? Trigger { get; set; } = null;
|
||||
|
||||
[Column(Order = 10)]
|
||||
public LocaleString? Target { get; set; } = null;
|
||||
|
||||
[Column(Order = 11)]
|
||||
public LocaleString? Cost { get; set; } = null;
|
||||
|
||||
[Column(Order = 12)]
|
||||
public LocaleString? Requirement { get; set; } = null;
|
||||
|
||||
/*
|
||||
[Column(Order = 4)]
|
||||
public bool Counteraction { get; set; }
|
||||
@@ -71,7 +80,5 @@ public class Spell : IEntity
|
||||
|
||||
public virtual ICollection<SpellArea> SpellAreas { get; set; } = [];
|
||||
|
||||
public virtual SpellRitual? SpellRitual { get; set; }
|
||||
|
||||
public virtual ICollection<SpellDefense> SpellDefenses { get; set; } = new List<SpellDefense>();
|
||||
}
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Pf2eModel.Model.Structure.SpellRelation;
|
||||
|
||||
public class SpellRitual
|
||||
{
|
||||
[Key]
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
[Column(Order = 1)]
|
||||
public int SpellId { get; set; }
|
||||
|
||||
[Column(Order = 2)]
|
||||
[MaxLength(255)]
|
||||
public string PrimaryCheck { get; set; } = null!;
|
||||
|
||||
[Column(Order = 3)]
|
||||
public int SecondaryCasters { get; set; }
|
||||
|
||||
[Column(Order = 4)]
|
||||
[MaxLength(255)]
|
||||
public string SecondaryChecks { get; set; } = null!;
|
||||
|
||||
public virtual Spell Spell { get; set; } = null!;
|
||||
}
|
||||
@@ -14,6 +14,7 @@ using Pf2eModel.Model.Structure.BackgroundRelation;
|
||||
using Pf2eModel.Model.Structure.ClassRelation;
|
||||
using Pf2eModel.Model.Structure.DeityRelation;
|
||||
using Pf2eModel.Model.Structure.FeatRelation;
|
||||
using Pf2eModel.Model.Structure.RitualRelation;
|
||||
using Pf2eModel.Model.Structure.SpellRelation;
|
||||
|
||||
namespace Pf2eModel;
|
||||
@@ -93,6 +94,12 @@ public partial class Pf2eDbContext : DbContext
|
||||
|
||||
public virtual DbSet<Language> Languages { get; set; }
|
||||
|
||||
public virtual DbSet<Ritual> Rituals { get; set; }
|
||||
|
||||
public virtual DbSet<RitualArea> RitualAreas { get; set; }
|
||||
|
||||
public virtual DbSet<RitualCheck> RitualChecks { get; set; }
|
||||
|
||||
public virtual DbSet<Source> Sources { get; set; }
|
||||
|
||||
public virtual DbSet<Spell> Spells { get; set; }
|
||||
@@ -103,8 +110,6 @@ public partial class Pf2eDbContext : DbContext
|
||||
|
||||
public virtual DbSet<SpellDefense> SpellDefenses { get; set; }
|
||||
|
||||
public virtual DbSet<SpellRitual> SpellRituals { get; set; }
|
||||
|
||||
public virtual DbSet<Training> Trainings { get; set; }
|
||||
|
||||
public virtual DbSet<Trait> Traits { get; set; }
|
||||
@@ -114,12 +119,12 @@ public partial class Pf2eDbContext : DbContext
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
DotEnv.Load(options: new DotEnvOptions(probeForEnv: true, probeLevelsToSearch: 2));
|
||||
string databaseCnnection = EnvReader.GetStringValue("DATABASE_CONNECTION");
|
||||
string databaseConnection = EnvReader.GetStringValue("DATABASE_CONNECTION");
|
||||
|
||||
// optionsBuilder.LogTo(Console.WriteLine);
|
||||
optionsBuilder.UseSnakeCaseNamingConvention();
|
||||
optionsBuilder.UseNpgsql(
|
||||
databaseCnnection,
|
||||
databaseConnection,
|
||||
builder =>
|
||||
{
|
||||
builder
|
||||
@@ -143,7 +148,7 @@ public partial class Pf2eDbContext : DbContext
|
||||
.MapEnum<SpellDamageKinds>()
|
||||
.MapEnum<SpellTradition>()
|
||||
.MapEnum<AttributeValues>()
|
||||
.MapEnum<TrainingStage>()
|
||||
.MapEnum<TrainingRank>()
|
||||
.MapEnum<SourceCategory>();
|
||||
}
|
||||
);
|
||||
|
||||
@@ -18,6 +18,7 @@ using Pf2eModel.Model.Structure.BackgroundRelation;
|
||||
using Pf2eModel.Model.Structure.ClassRelation;
|
||||
using Pf2eModel.Model.Structure.DeityRelation;
|
||||
using Pf2eModel.Model.Structure.FeatRelation;
|
||||
using Pf2eModel.Model.Structure.RitualRelation;
|
||||
using Pf2eModel.Model.Structure.SpellRelation;
|
||||
|
||||
namespace Pf2eModel;
|
||||
@@ -81,7 +82,7 @@ public partial class Pf2eDbContext
|
||||
.HasPostgresEnum<SpellDamageKinds>()
|
||||
.HasPostgresEnum<SpellTradition>()
|
||||
.HasPostgresEnum<AttributeValues>()
|
||||
.HasPostgresEnum<TrainingStage>()
|
||||
.HasPostgresEnum<TrainingRank>()
|
||||
.HasPostgresEnum<SourceCategory>();
|
||||
}
|
||||
|
||||
@@ -436,6 +437,8 @@ public partial class Pf2eDbContext
|
||||
|
||||
BindLocaleString(entity, s => s.Trigger, false);
|
||||
BindLocaleString(entity, s => s.Target, false);
|
||||
BindLocaleString(entity, s => s.Cost, false);
|
||||
BindLocaleString(entity, s => s.Requirement, false);
|
||||
|
||||
entity
|
||||
.HasMany(e => e.SpellAreas)
|
||||
@@ -443,13 +446,6 @@ public partial class Pf2eDbContext
|
||||
.HasForeignKey(e => e.SpellId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
entity
|
||||
.HasOne(e => e.SpellRitual)
|
||||
.WithOne(e => e.Spell)
|
||||
.HasForeignKey<SpellRitual>(e => e.SpellId)
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired(false);
|
||||
|
||||
entity
|
||||
.HasMany(e => e.SpellDefenses)
|
||||
.WithOne(e => e.Spell)
|
||||
@@ -461,7 +457,46 @@ public partial class Pf2eDbContext
|
||||
BindLocaleString(entity, a => a.Details, false);
|
||||
});
|
||||
modelBuilder.Entity<SpellDefense>(entity => { });
|
||||
modelBuilder.Entity<SpellRitual>(entity => { });
|
||||
|
||||
// Ritual
|
||||
modelBuilder.Entity<Ritual>(entity =>
|
||||
{
|
||||
BindEntity(entity);
|
||||
|
||||
BindLocaleString(entity, s => s.RangeString, false);
|
||||
BindLocaleString(entity, s => s.Target, false);
|
||||
BindLocaleString(entity, s => s.Cost, false);
|
||||
BindLocaleString(entity, s => s.Requirement, false);
|
||||
BindLocaleString(entity, s => s.PrimaryCheckSuffix, false);
|
||||
BindLocaleString(entity, s => s.SecondaryCastersSuffix, false);
|
||||
|
||||
entity
|
||||
.HasOne(r => r.Area)
|
||||
.WithOne(a => a.Ritual)
|
||||
.HasForeignKey<RitualArea>(a => a.RitualId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
entity
|
||||
.HasMany(r => r.Checks)
|
||||
.WithOne(c => c.Ritual)
|
||||
.HasForeignKey(c => c.RitualId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
modelBuilder.Entity<RitualArea>(entity =>
|
||||
{
|
||||
BindLocaleString(entity, a => a.Details, false);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<RitualCheck>(entity =>
|
||||
{
|
||||
BindLocaleString(entity, a => a.TrainingString, false);
|
||||
|
||||
entity
|
||||
.HasOne(c => c.Training)
|
||||
.WithMany()
|
||||
.HasForeignKey(c => c.TrainingId)
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
});
|
||||
|
||||
// Trait
|
||||
modelBuilder.Entity<Trait>(entity =>
|
||||
|
||||
Reference in New Issue
Block a user