1570 lines
78 KiB
C#
1570 lines
78 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
using Pf2eModel.Model.Enum;
|
|
|
|
#nullable disable
|
|
|
|
namespace Pf2eModel.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class _1 : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterDatabase()
|
|
.Annotation("Npgsql:Enum:action_category", "archetype,army_tactic,army_war_action,class-feat,class-feature,defensive,familiar,interaction,kingdom_activity,kingdom_feat,kingdom_feature,offensive,unknown")
|
|
.Annotation("Npgsql:Enum:action_enum", "1,1 hour,1 minute,1-2,1-3,10 minutes,2,2-3,2/2 rounds,3,30 minutes,5 minutes,free,free/1,other,passive,reaction,reaction/1,reaction/2,reaction/3,unknown")
|
|
.Annotation("Npgsql:Enum:attribute_values", "cha,con,dex,free,int,str,wis")
|
|
.Annotation("Npgsql:Enum:class_progression_type", "ancestry_feat,attribute_increase,class_feat,entity,general_feat,skill_feat,skill_increase")
|
|
.Annotation("Npgsql:Enum:condition_group", "abilities,attitudes,death,detection,senses,unknown")
|
|
.Annotation("Npgsql:Enum:deity_category", "covenant,deity,pantheon,philosophy")
|
|
.Annotation("Npgsql:Enum:deity_fonts", "any,harm,heal,none")
|
|
.Annotation("Npgsql:Enum:deity_sanctification", "any,holy,unholy")
|
|
.Annotation("Npgsql:Enum:element_enum", "air,earth,fire,metal,universal,water,wood")
|
|
.Annotation("Npgsql:Enum:entity_rarity", "common,rare,uncommon,unique")
|
|
.Annotation("Npgsql:Enum:entity_type", "action,ancestry,archetype,background,backpack,campaign_feature,class,condition,deity,feat,heritage,language,ritual,rule,spell,subclass,subclass_group,trait,unknown")
|
|
.Annotation("Npgsql:Enum:feat_category", "ancestry,ancestry-feature,archetype,bonus,calling,campaign-feature,class,class-feature,curse,deityboon,general,pfsboon,skill,uncategorized")
|
|
.Annotation("Npgsql:Enum:locale_type", "english,hobby,legacy,legacy_english,other,russian")
|
|
.Annotation("Npgsql:Enum:size_enum", "huge,large,medium,small,tiny")
|
|
.Annotation("Npgsql:Enum:source_category", "adventure-path,adventures,blog-posts,comics,lost-omens,rulebook,society")
|
|
.Annotation("Npgsql:Enum:spell_area_type", "burst,circle,cone,cube,cuboid,cylinder,emanation,line,other,square,varies")
|
|
.Annotation("Npgsql:Enum:spell_damage_category", "normal,persistent,splash")
|
|
.Annotation("Npgsql:Enum:spell_damage_kinds", "any,damage,healing")
|
|
.Annotation("Npgsql:Enum:spell_tradition", "all,arcane,divine,elemental,none,occult,primal")
|
|
.Annotation("Npgsql:Enum:training_rank", "expert,legendary,master,mythic,trained,untrained")
|
|
.Annotation("Npgsql:Enum:trait_type", "class,regular,tradition")
|
|
.Annotation("Npgsql:Enum:vision_enum", "dark-vision,low-light-vision,normal");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "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: "Отображаемое имя"),
|
|
type = table.Column<EntityType>(type: "entity_type", nullable: false, comment: "Тип сущности"),
|
|
slug = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Часть имени в URL"),
|
|
img = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Изображение объекта"),
|
|
description = table.Column<string>(type: "text", nullable: false, comment: "Текстовое описание сущности"),
|
|
rarity = table.Column<EntityRarity>(type: "entity_rarity", nullable: false, comment: "Редкость сущности"),
|
|
is_translated = table.Column<bool>(type: "boolean", nullable: true, comment: "Флаг, указывающий, что у сущности существует перевод"),
|
|
is_checked = table.Column<bool>(type: "boolean", nullable: true, comment: "Флаг, указывающий, что сущность был проверен и не требует автоматической перезаписи")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_entities", x => x.id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "external_targets",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
name = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Отображаемое имя"),
|
|
icon = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Иконка цели"),
|
|
prefix = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Префикс для URL-адреса внешней ссылки")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_external_targets", x => x.id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "frequencies",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
max = table.Column<int>(type: "integer", nullable: false, comment: "Максимальная продолжительсность"),
|
|
per = table.Column<int>(type: "integer", nullable: false, comment: "Частота использования"),
|
|
value = table.Column<int>(type: "integer", nullable: true, comment: "Значение использования")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_frequencies", x => x.id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "keywords",
|
|
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: "Отображаемое имя"),
|
|
slug = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Часть имени в URL")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_keywords", x => x.id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "sources",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
name = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Отображаемое имя"),
|
|
category = table.Column<SourceCategory>(type: "source_category", nullable: false, comment: "Категория источника"),
|
|
release_date = table.Column<DateOnly>(type: "date", nullable: true, comment: "Дата выхода источника")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_sources", x => x.id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "trainings",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
name = table.Column<string>(type: "jsonb", nullable: false, comment: "Название способности"),
|
|
type = table.Column<int>(type: "integer", nullable: false, comment: "Тип способности")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_trainings", x => x.id);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "actions",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
|
|
actions = table.Column<ActionEnum>(type: "action_enum", nullable: false, comment: "Количество действий"),
|
|
extra = table.Column<string>(type: "text", nullable: true, comment: "Дополнительная информация")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_actions", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_actions_entities_id",
|
|
column: x => x.id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "ancestries",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
|
|
size = table.Column<SizeEnum[]>(type: "size_enum[]", nullable: false, comment: "Размеры родословной"),
|
|
hp = table.Column<int>(type: "integer", nullable: false, comment: "Количество очков здоровья"),
|
|
speed = table.Column<int>(type: "integer", nullable: false, comment: "Скорость передвижения"),
|
|
vision_enum = table.Column<VisionEnum>(type: "vision_enum", nullable: false, comment: "Тип зрения")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_ancestries", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_ancestries_entities_id",
|
|
column: x => x.id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "backgrounds",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_backgrounds", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_backgrounds_entities_id",
|
|
column: x => x.id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "classes",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
|
|
hp = table.Column<int>(type: "integer", nullable: false, comment: "Количество очков здоровья"),
|
|
spellcasting = table.Column<bool>(type: "boolean", nullable: false, comment: "Заклинатель?"),
|
|
tradition = table.Column<SpellTradition>(type: "spell_tradition", nullable: true, comment: "Традиция заклинаний"),
|
|
additional_trained_skills = table.Column<int>(type: "integer", nullable: false, comment: "Дополнительные навыки")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_classes", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_classes_entities_id",
|
|
column: x => x.id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "conditions",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
|
|
group = table.Column<ConditionGroup>(type: "condition_group", nullable: true, comment: "Группа состояния"),
|
|
extra = table.Column<string>(type: "text", nullable: true, comment: "Дополнительная информация")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_conditions", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_conditions_entities_id",
|
|
column: x => x.id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "deities",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
|
|
category = table.Column<DeityCategory>(type: "deity_category", nullable: false, comment: "Тип божества"),
|
|
fonts = table.Column<DeityFonts>(type: "deity_fonts", nullable: false, comment: "Тип божественной силы"),
|
|
sanctification = table.Column<DeitySanctification>(type: "deity_sanctification", nullable: false, comment: "Тип освящения"),
|
|
sanctification_must = table.Column<bool>(type: "boolean", nullable: false, comment: "Обязательное освящение")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_deities", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_deities_entities_id",
|
|
column: x => x.id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
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
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
|
|
category = table.Column<FeatCategory>(type: "feat_category", nullable: false, comment: "Категория способности"),
|
|
level = table.Column<int>(type: "integer", nullable: false, comment: "Уровень способности"),
|
|
actions = table.Column<int>(type: "integer", nullable: true, comment: "Количество действий"),
|
|
max_actions = table.Column<int>(type: "integer", nullable: true),
|
|
is_reaction = table.Column<bool>(type: "boolean", nullable: false),
|
|
is_free_action = table.Column<bool>(type: "boolean", nullable: false),
|
|
is_passive = table.Column<bool>(type: "boolean", nullable: false),
|
|
extra = table.Column<string>(type: "text", nullable: true, comment: "Дополнительная информация")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_feats", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_feats_entities_id",
|
|
column: x => x.id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "languages",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
|
|
entity_id = table.Column<int>(type: "integer", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_languages", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_languages_entities_entity_id",
|
|
column: x => x.entity_id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
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: "Идентификатор цели")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_legacy_remasters", x => new { x.legacy_id, x.remaster_id });
|
|
table.ForeignKey(
|
|
name: "fk_legacy_remasters_entities_legacy_id",
|
|
column: x => x.legacy_id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_legacy_remasters_entities_remaster_id",
|
|
column: x => x.remaster_id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "rituals",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
|
|
level = table.Column<int>(type: "integer", nullable: false, comment: "Уровень ритуала"),
|
|
cast_time = table.Column<int>(type: "integer", nullable: false, comment: "Продолжительность ритуала в секундах"),
|
|
duration = table.Column<int>(type: "integer", nullable: false, comment: "Время действия эффекта ритуала в секундах"),
|
|
elements = table.Column<ElementEnum[]>(type: "element_enum[]", nullable: false, comment: "Элементы ритуала"),
|
|
range = table.Column<int>(type: "integer", nullable: false, comment: "Дальнность ритуала"),
|
|
primary_check_rank = table.Column<TrainingRank>(type: "training_rank", nullable: false, comment: "Ранг основной проверки"),
|
|
primary_check_suffix = table.Column<string>(type: "jsonb", nullable: true, comment: "Дополнительная информация об основной проверки"),
|
|
secondary_casters = table.Column<int>(type: "integer", nullable: false, comment: "Количество дополнительных заклинателей"),
|
|
secondary_casters_max = table.Column<int>(type: "integer", nullable: false, comment: "Максимальное количество дополнительных заклинателей"),
|
|
secondary_casters_suffix = table.Column<string>(type: "jsonb", nullable: true, comment: "Дополнительная информация о дополнительных заклинателях"),
|
|
range_string = table.Column<string>(type: "jsonb", nullable: true, comment: "Дальность ритуала"),
|
|
target = table.Column<string>(type: "jsonb", nullable: true, comment: "Цель ритуала"),
|
|
cost = table.Column<string>(type: "jsonb", nullable: true, comment: "Стоимость ритуала"),
|
|
requirement = table.Column<string>(type: "jsonb", nullable: true, comment: "Требования к ритуалу")
|
|
},
|
|
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: "rules",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
|
|
order = table.Column<int>(type: "integer", nullable: false, comment: "Порядок отображения"),
|
|
parent_id = table.Column<int>(type: "integer", nullable: true, comment: "Родительского правило"),
|
|
breadcrumbs = table.Column<string[]>(type: "text[]", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_rules", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_rules_entities_id",
|
|
column: x => x.id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_rules_rules_parent_id",
|
|
column: x => x.parent_id,
|
|
principalTable: "rules",
|
|
principalColumn: "id");
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "spells",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
|
|
level = table.Column<int>(type: "integer", nullable: false),
|
|
is_focus = table.Column<bool>(type: "boolean", nullable: false, comment: "Фокус?"),
|
|
actions = table.Column<ActionEnum>(type: "action_enum", nullable: false, comment: "Количество действий"),
|
|
duration = table.Column<int>(type: "integer", maxLength: 255, nullable: true, comment: "Время длительности заклинания"),
|
|
range = table.Column<int>(type: "integer", nullable: false, comment: "Дальность заклинания"),
|
|
traditions = table.Column<SpellTradition[]>(type: "spell_tradition[]", nullable: false, comment: "Традиции заклинания"),
|
|
elements = table.Column<ElementEnum[]>(type: "element_enum[]", nullable: false, comment: "Элементы заклинания"),
|
|
trigger = table.Column<string>(type: "jsonb", nullable: true, comment: "Триггер заклинания"),
|
|
target = table.Column<string>(type: "jsonb", nullable: true, comment: "Цель заклинания"),
|
|
cost = table.Column<string>(type: "jsonb", nullable: true, comment: "Стоимость заклинания"),
|
|
requirement = table.Column<string>(type: "jsonb", nullable: true, comment: "Требования к заклинанию")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_spells", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_spells_entities_id",
|
|
column: x => x.id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "traits",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
|
|
type = table.Column<TraitType>(type: "trait_type", nullable: false, comment: "Тип признака")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_traits", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_traits_entities_id",
|
|
column: x => x.id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "entity_externals",
|
|
columns: table => new
|
|
{
|
|
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_entity_externals", x => new { x.entity_id, x.target_id });
|
|
table.ForeignKey(
|
|
name: "fk_entity_externals_entities_entity_id",
|
|
column: x => x.entity_id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_entity_externals_external_targets_target_id",
|
|
column: x => x.target_id,
|
|
principalTable: "external_targets",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "entity_keyword",
|
|
columns: table => new
|
|
{
|
|
entities_id = table.Column<int>(type: "integer", nullable: false),
|
|
keywords_id = table.Column<int>(type: "integer", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_entity_keyword", x => new { x.entities_id, x.keywords_id });
|
|
table.ForeignKey(
|
|
name: "fk_entity_keyword_entities_entities_id",
|
|
column: x => x.entities_id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_entity_keyword_keywords_keywords_id",
|
|
column: x => x.keywords_id,
|
|
principalTable: "keywords",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "keyword_aliases",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор")
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
keyword_id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор ключевого слова"),
|
|
value = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false, comment: "Синоним")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_keyword_aliases", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_keyword_aliases_keywords_keyword_id",
|
|
column: x => x.keyword_id,
|
|
principalTable: "keywords",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "entity_sources",
|
|
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: "Идентификатор сущности"),
|
|
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_entity_sources", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_entity_sources_entities_entity_id",
|
|
column: x => x.entity_id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_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
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
ancestry_id = table.Column<int>(type: "integer", nullable: false),
|
|
boost = table.Column<bool>(type: "boolean", nullable: false),
|
|
value = table.Column<AttributeValues>(type: "attribute_values", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_ancestry_boosts", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_ancestry_boosts_ancestries_ancestry_id",
|
|
column: x => x.ancestry_id,
|
|
principalTable: "ancestries",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "ancestry_items",
|
|
columns: table => new
|
|
{
|
|
ancestry_id = table.Column<int>(type: "integer", nullable: false),
|
|
item_id = table.Column<int>(type: "integer", nullable: false),
|
|
level = table.Column<int>(type: "integer", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_ancestry_items", x => new { x.ancestry_id, x.item_id });
|
|
table.ForeignKey(
|
|
name: "fk_ancestry_items_ancestries_ancestry_id",
|
|
column: x => x.ancestry_id,
|
|
principalTable: "ancestries",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_ancestry_items_entities_item_id",
|
|
column: x => x.item_id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "heritages",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
|
|
ancestry_id = table.Column<int>(type: "integer", nullable: true, comment: "Идентификатор родословной")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_heritages", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_heritages_ancestries_ancestry_id",
|
|
column: x => x.ancestry_id,
|
|
principalTable: "ancestries",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_heritages_entities_id",
|
|
column: x => x.id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "background_boosts",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
background_id = table.Column<int>(type: "integer", nullable: false),
|
|
attribute = table.Column<AttributeValues>(type: "attribute_values", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_background_boosts", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_background_boosts_backgrounds_background_id",
|
|
column: x => x.background_id,
|
|
principalTable: "backgrounds",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "background_items",
|
|
columns: table => new
|
|
{
|
|
background_id = table.Column<int>(type: "integer", nullable: false),
|
|
entity_id = table.Column<int>(type: "integer", nullable: false),
|
|
level = table.Column<int>(type: "integer", nullable: true)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_background_items", x => new { x.background_id, x.entity_id });
|
|
table.ForeignKey(
|
|
name: "fk_background_items_backgrounds_background_id",
|
|
column: x => x.background_id,
|
|
principalTable: "backgrounds",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_background_items_entities_entity_id",
|
|
column: x => x.entity_id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "background_skills",
|
|
columns: table => new
|
|
{
|
|
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),
|
|
rank = table.Column<TrainingRank>(type: "training_rank", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_background_skills", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_background_skills_backgrounds_background_id",
|
|
column: x => x.background_id,
|
|
principalTable: "backgrounds",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_background_skills_trainings_training_id",
|
|
column: x => x.training_id,
|
|
principalTable: "trainings",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "class_key_abilities",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
class_id = table.Column<int>(type: "integer", nullable: false),
|
|
value = table.Column<AttributeValues>(type: "attribute_values", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_class_key_abilities", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_class_key_abilities_classes_class_id",
|
|
column: x => x.class_id,
|
|
principalTable: "classes",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "class_progressions",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
class_id = table.Column<int>(type: "integer", nullable: false),
|
|
type = table.Column<ClassProgressionType>(type: "class_progression_type", nullable: false),
|
|
entity_id = table.Column<int>(type: "integer", nullable: true),
|
|
level = table.Column<int>(type: "integer", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_class_progressions", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_class_progressions_classes_class_id",
|
|
column: x => x.class_id,
|
|
principalTable: "classes",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_class_progressions_entities_entity_id",
|
|
column: x => x.entity_id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.SetNull);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "class_trainings",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
class_id = table.Column<int>(type: "integer", nullable: false),
|
|
training_id = table.Column<int>(type: "integer", nullable: true),
|
|
rank = table.Column<TrainingRank>(type: "training_rank", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_class_trainings", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_class_trainings_classes_class_id",
|
|
column: x => x.class_id,
|
|
principalTable: "classes",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_class_trainings_trainings_training_id",
|
|
column: x => x.training_id,
|
|
principalTable: "trainings",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.SetNull);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "subclass_groups",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
|
|
class_id = table.Column<int>(type: "integer", nullable: true, comment: "Идентификатор класса")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_subclass_groups", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_subclass_groups_classes_class_id",
|
|
column: x => x.class_id,
|
|
principalTable: "classes",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_subclass_groups_entities_id",
|
|
column: x => x.id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "deity_attributes",
|
|
columns: table => new
|
|
{
|
|
deity_id = table.Column<int>(type: "integer", nullable: false),
|
|
attribute = table.Column<AttributeValues>(type: "attribute_values", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_deity_attributes", x => new { x.deity_id, x.attribute });
|
|
table.ForeignKey(
|
|
name: "fk_deity_attributes_deities_deity_id",
|
|
column: x => x.deity_id,
|
|
principalTable: "deities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "deity_domains",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
deity_id = table.Column<int>(type: "integer", nullable: false),
|
|
is_primary = table.Column<bool>(type: "boolean", nullable: false),
|
|
value = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_deity_domains", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_deity_domains_deities_deity_id",
|
|
column: x => x.deity_id,
|
|
principalTable: "deities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "deity_training",
|
|
columns: table => new
|
|
{
|
|
deity_id = table.Column<int>(type: "integer", nullable: false),
|
|
skills_id = table.Column<int>(type: "integer", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_deity_training", x => new { x.deity_id, x.skills_id });
|
|
table.ForeignKey(
|
|
name: "fk_deity_training_deities_deity_id",
|
|
column: x => x.deity_id,
|
|
principalTable: "deities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_deity_training_trainings_skills_id",
|
|
column: x => x.skills_id,
|
|
principalTable: "trainings",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "deity_weapons",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
deity_id = table.Column<int>(type: "integer", nullable: false),
|
|
weapon = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_deity_weapons", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_deity_weapons_deities_deity_id",
|
|
column: x => x.deity_id,
|
|
principalTable: "deities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "archetypes",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
|
|
level = table.Column<int>(type: "integer", nullable: false, comment: "Уровень"),
|
|
dedication_feat_id = table.Column<int>(type: "integer", nullable: true, comment: "ID посвящения"),
|
|
extra = table.Column<string>(type: "text", nullable: true, comment: "Дополнительная информация")
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_archetypes", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_archetypes_entities_id",
|
|
column: x => x.id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_archetypes_feats_dedication_feat_id",
|
|
column: x => x.dedication_feat_id,
|
|
principalTable: "feats",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "feat_prerequisites",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
feat_id = table.Column<int>(type: "integer", nullable: false),
|
|
value = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_feat_prerequisites", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_feat_prerequisites_feats_feat_id",
|
|
column: x => x.feat_id,
|
|
principalTable: "feats",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "ancestry_languages",
|
|
columns: table => new
|
|
{
|
|
ancestry_id = table.Column<int>(type: "integer", nullable: false),
|
|
language_id = table.Column<int>(type: "integer", nullable: false),
|
|
is_additional = table.Column<bool>(type: "boolean", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_ancestry_languages", x => new { x.ancestry_id, x.language_id });
|
|
table.ForeignKey(
|
|
name: "fk_ancestry_languages_ancestries_ancestry_id",
|
|
column: x => x.ancestry_id,
|
|
principalTable: "ancestries",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_ancestry_languages_languages_language_id",
|
|
column: x => x.language_id,
|
|
principalTable: "languages",
|
|
principalColumn: "id",
|
|
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_primary = 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
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
deity_id = table.Column<int>(type: "integer", nullable: false),
|
|
level = table.Column<int>(type: "integer", nullable: false),
|
|
spell_id = table.Column<int>(type: "integer", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_deity_spells", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_deity_spells_deities_deity_id",
|
|
column: x => x.deity_id,
|
|
principalTable: "deities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_deity_spells_spells_spell_id",
|
|
column: x => x.spell_id,
|
|
principalTable: "spells",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "spell_areas",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
spell_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_spell_areas", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_spell_areas_spells_spell_id",
|
|
column: x => x.spell_id,
|
|
principalTable: "spells",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "spell_damages",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
spell_id = table.Column<int>(type: "integer", nullable: false),
|
|
key = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
|
|
apply_mod = table.Column<bool>(type: "boolean", nullable: true),
|
|
category = table.Column<SpellDamageCategory>(type: "spell_damage_category", nullable: true),
|
|
formula = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
|
|
kinds = table.Column<SpellDamageKinds>(type: "spell_damage_kinds", nullable: false),
|
|
materials = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
|
|
type = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_spell_damages", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_spell_damages_spells_spell_id",
|
|
column: x => x.spell_id,
|
|
principalTable: "spells",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "spell_defenses",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
spell_id = table.Column<int>(type: "integer", nullable: false),
|
|
is_passive = table.Column<bool>(type: "boolean", nullable: false),
|
|
is_basic = table.Column<bool>(type: "boolean", nullable: true),
|
|
statistic = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_spell_defenses", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_spell_defenses_spells_spell_id",
|
|
column: x => x.spell_id,
|
|
principalTable: "spells",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "entity_trait",
|
|
columns: table => new
|
|
{
|
|
entities_id = table.Column<int>(type: "integer", nullable: false),
|
|
traits_id = table.Column<int>(type: "integer", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_entity_trait", x => new { x.entities_id, x.traits_id });
|
|
table.ForeignKey(
|
|
name: "fk_entity_trait_entities_entities_id",
|
|
column: x => x.entities_id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_entity_trait_traits_traits_id",
|
|
column: x => x.traits_id,
|
|
principalTable: "traits",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "subclasses",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false, comment: "Идентификатор"),
|
|
group_id = table.Column<int>(type: "integer", nullable: false, comment: "Группа подклассов"),
|
|
additional = table.Column<string>(type: "jsonb", nullable: false, comment: "Дополнительная информация"),
|
|
extra = table.Column<string>(type: "text", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_subclasses", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_subclasses_entities_id",
|
|
column: x => x.id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_subclasses_subclass_groups_group_id",
|
|
column: x => x.group_id,
|
|
principalTable: "subclass_groups",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "archetype_feats",
|
|
columns: table => new
|
|
{
|
|
archetype_id = table.Column<int>(type: "integer", nullable: false),
|
|
feat_id = table.Column<int>(type: "integer", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_archetype_feats", x => new { x.archetype_id, x.feat_id });
|
|
table.ForeignKey(
|
|
name: "fk_archetype_feats_archetypes_archetype_id",
|
|
column: x => x.archetype_id,
|
|
principalTable: "archetypes",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_archetype_feats_feats_feat_id",
|
|
column: x => x.feat_id,
|
|
principalTable: "feats",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "subclass_provided_entities",
|
|
columns: table => new
|
|
{
|
|
subclass_id = table.Column<int>(type: "integer", nullable: false),
|
|
entity_id = table.Column<int>(type: "integer", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_subclass_provided_entities", x => new { x.subclass_id, x.entity_id });
|
|
table.ForeignKey(
|
|
name: "fk_subclass_provided_entities_entities_entity_id",
|
|
column: x => x.entity_id,
|
|
principalTable: "entities",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_subclass_provided_entities_subclasses_subclass_id",
|
|
column: x => x.subclass_id,
|
|
principalTable: "subclasses",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "subclass_trainings",
|
|
columns: table => new
|
|
{
|
|
id = table.Column<int>(type: "integer", nullable: false)
|
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
subclass_id = table.Column<int>(type: "integer", nullable: false),
|
|
training_id = table.Column<int>(type: "integer", nullable: false),
|
|
rank = table.Column<TrainingRank>(type: "training_rank", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("pk_subclass_trainings", x => x.id);
|
|
table.ForeignKey(
|
|
name: "fk_subclass_trainings_subclasses_subclass_id",
|
|
column: x => x.subclass_id,
|
|
principalTable: "subclasses",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "fk_subclass_trainings_trainings_training_id",
|
|
column: x => x.training_id,
|
|
principalTable: "trainings",
|
|
principalColumn: "id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_ancestry_boosts_ancestry_id",
|
|
table: "ancestry_boosts",
|
|
column: "ancestry_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_ancestry_items_item_id",
|
|
table: "ancestry_items",
|
|
column: "item_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_ancestry_languages_language_id",
|
|
table: "ancestry_languages",
|
|
column: "language_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_archetype_feats_feat_id",
|
|
table: "archetype_feats",
|
|
column: "feat_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_archetypes_dedication_feat_id",
|
|
table: "archetypes",
|
|
column: "dedication_feat_id",
|
|
unique: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_background_boosts_background_id",
|
|
table: "background_boosts",
|
|
column: "background_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_background_items_entity_id",
|
|
table: "background_items",
|
|
column: "entity_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_background_skills_background_id",
|
|
table: "background_skills",
|
|
column: "background_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_background_skills_training_id",
|
|
table: "background_skills",
|
|
column: "training_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_class_key_abilities_class_id",
|
|
table: "class_key_abilities",
|
|
column: "class_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_class_progressions_class_id",
|
|
table: "class_progressions",
|
|
column: "class_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_class_progressions_entity_id",
|
|
table: "class_progressions",
|
|
column: "entity_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_class_trainings_class_id",
|
|
table: "class_trainings",
|
|
column: "class_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_class_trainings_training_id",
|
|
table: "class_trainings",
|
|
column: "training_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_deity_domains_deity_id",
|
|
table: "deity_domains",
|
|
column: "deity_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_deity_spells_deity_id",
|
|
table: "deity_spells",
|
|
column: "deity_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_deity_spells_spell_id",
|
|
table: "deity_spells",
|
|
column: "spell_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_deity_training_skills_id",
|
|
table: "deity_training",
|
|
column: "skills_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_deity_weapons_deity_id",
|
|
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",
|
|
column: "target_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_entity_keyword_keywords_id",
|
|
table: "entity_keyword",
|
|
column: "keywords_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_entity_sources_entity_id",
|
|
table: "entity_sources",
|
|
column: "entity_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_entity_sources_source_id",
|
|
table: "entity_sources",
|
|
column: "source_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_entity_trait_traits_id",
|
|
table: "entity_trait",
|
|
column: "traits_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_feat_prerequisites_feat_id",
|
|
table: "feat_prerequisites",
|
|
column: "feat_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_heritages_ancestry_id",
|
|
table: "heritages",
|
|
column: "ancestry_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_keyword_aliases_keyword_id",
|
|
table: "keyword_aliases",
|
|
column: "keyword_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_languages_entity_id",
|
|
table: "languages",
|
|
column: "entity_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_legacy_remasters_remaster_id",
|
|
table: "legacy_remasters",
|
|
column: "remaster_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_rules_parent_id",
|
|
table: "rules",
|
|
column: "parent_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_spell_areas_spell_id",
|
|
table: "spell_areas",
|
|
column: "spell_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_spell_damages_spell_id",
|
|
table: "spell_damages",
|
|
column: "spell_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_spell_defenses_spell_id",
|
|
table: "spell_defenses",
|
|
column: "spell_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_subclass_groups_class_id",
|
|
table: "subclass_groups",
|
|
column: "class_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_subclass_provided_entities_entity_id",
|
|
table: "subclass_provided_entities",
|
|
column: "entity_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_subclass_trainings_subclass_id",
|
|
table: "subclass_trainings",
|
|
column: "subclass_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_subclass_trainings_training_id",
|
|
table: "subclass_trainings",
|
|
column: "training_id");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "ix_subclasses_group_id",
|
|
table: "subclasses",
|
|
column: "group_id");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "actions");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "ancestry_boosts");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "ancestry_items");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "ancestry_languages");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "archetype_feats");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "background_boosts");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "background_items");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "background_skills");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "class_key_abilities");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "class_progressions");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "class_trainings");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "conditions");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "deity_attributes");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "deity_domains");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "deity_spells");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "deity_training");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "deity_weapons");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "entity_aliases");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "entity_externals");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "entity_keyword");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "entity_sources");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "entity_trait");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "feat_prerequisites");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "frequencies");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "heritages");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "keyword_aliases");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "legacy_remasters");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "ritual_areas");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "ritual_checks");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "rules");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "spell_areas");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "spell_damages");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "spell_defenses");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "subclass_provided_entities");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "subclass_trainings");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "languages");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "archetypes");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "backgrounds");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "deities");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "external_targets");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "sources");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "traits");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "ancestries");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "keywords");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "rituals");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "spells");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "subclasses");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "trainings");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "feats");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "subclass_groups");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "classes");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "entities");
|
|
}
|
|
}
|
|
}
|