// https://dbml.dbdiagram.io/docs // https://dbdiagram.io/d/Shema-BD-dlya-perevodov-Pf2e-67f0f7de4f7afba18471ab41 // Entity Table entity { id int [pk, increment] name varchar [not null, note: "{*}.name"] img varchar(100) [not null, note: "{*}.img"] description text [not null, note: "{*}.system.description(.value)"] description_gm text [null, note: "{*}.system.description.gm"] type entity_type [not null, note: "Таблица, к которому относится объект"] slug varchar [not null, note: "Отображения"] rarity entity_rarity [not null, default: "common", note: "{*}.system.traits.rarity"] is_translated bool [default: false, note: "Первичный импорт идёт из англоязычного источника, перевод приходит вторым"] is_checked bool [default: false, note: "Флаг, указывающий, что перевод был проверен вручную и не требует обновления парсером"] } Enum entity_type { action ancestry background backpack campaign_feature class condition deity feat heritage spell } Enum entity_rarity { common uncommon rare unique } // Alias Table entity_aliases { id int [pk, increment] entity_id int [not null, ref: > entity.id] alias varchar [not null] type alias_type [not null] } Enum alias_type { old english hobby } // Keywords Table keyword { id int [pk, increment] } Table entity_keywords { entity_id int [not null, ref: > entity.id] keyword_id int [not null, ref: > keyword.id] } Table keyword_aliases { keyword_id int [pk, ref: > keyword.id] type alias_type [pk] value varchar [not null] } // Sources Table source { id int [pk, increment] name varchar [not null] url varchar [not null] } Table entity_sources { entity_id int [not null, ref: > entity.id] source_id int [not null, ref: > source.id] suffix varchar [not null, default: "", note: "страница и проч."] is_remaster bool [not null] } // External links Table external_target { id int [pk, increment] name varchar [not null] icon varchar [not null] } Table entity_external { entity_id int [pk, ref: > entity.id] target_id int [pk, ref: > external_target.id] path varchar [not null] suffix varchar [not null, default: "", note: "Для источников Foundry - полный UUID объекта"] md5 varchar [not null, note: "Для контроля обновлений"] } // ---------------------------------------------- // Traits Table trait { id int [pk, increment] name varchar [not null] slug varchar [not null] description text [not null] type trait_type [not null] } Table entity_traits { entity_id int [pk, ref: > entity.id] trait_id int [pk, ref: > trait.id] } Enum trait_type { regular tradition } // Frequency Table frequency { id int [pk, ref: - entity.id] max int [not null, note: "{}.max"] per int [not null, note: "{}.per"] value int [null, note: "{}.value"] Note: '''{} = {Item.[action|feat].system.frequency} Используется для подключения полей из таблиц схем {Item.feat} и {Item.action}''' } // Languages Table language { id int [pk, increment] name varchar [not null] rarity entity_rarity [not null] } // Trainings Table trainings { id int [pk, increment] key varchar [not null] Note: "Текстовые записи - в глоссарии" } // ---------------------------------------------- // Action Table action { id int [pk, ref: - entity.id] type action_type [not null, note: "{}.actionType.value"] actions int [null, note: "{}.actions?.value"] category action_category [null, note: "{}.category"] // Нет у 81 объекта death_note bool [null, note: "{}.deathNote"] extra text [null, note: "json для того, что надо рассмотреть"] Note: '''{} = Item.action.system Перенаправление: {}.publication -> entity_sources {}.traits -> entity_traits {}.frequency -> frequency Рассмотреть: {}.selfEffect - служебный словарь Foundry ''' } Enum action_type { action free reaction passive } Enum action_category { offensive defensive interaction familiar } // Ancestry Table ancestry { id int [pk, ref: - entity.id] hp int [not null, note: "{}.hp"] reach int [not null, note: "{}.reach"] size ancestry_size [not null, note: "{}.size"] speed int [not null, note: "{}.speed"] vision ancestry_vision [not null, note: "{}.vision"] Note: '''{} = Item.ancestry.system Перенаправление: {}.publication -> entity_sources {}.traits -> entity_traits {}.additionalLanguages -> ancestry_languages {}.languages -> ancestry_languages {}.boosts -> ancestry_boosts {}.flaws -> ancestry_boosts {}.items -> ancestry_items ''' } Enum ancestry_size { med lanuages system tiny } Enum ancestry_vision { normal low_light_vision // low-light-vision darkvision } Table ancestry_languages { ancestry_id int [pk, ref: > ancestry.id] language_id int [pk, ref: > language.id] is_additional bool [not null] } Table ancestry_boosts { id int [pk, increment] ancestry_id int [not null, ref: > ancestry.id] boost bool [not null, default: true, note: "false = flaw"] value varchar(3) [null, note: "null = free boost (all 6 values in foundry)"] } Table ancestry_items { ancestry_id int [pk, ref: > ancestry.id] item_id int [pk, ref: > entity.id] level int [not null] } // Background Table background { id int [pk, ref: - entity.id] Note: '''{} = Item.background.system Перенаправление: {}.boosts -> background_boosts {}.publication -> entity_sources {}.traits -> entity_traits {}.items -> background_items {}.trainedSkills -> background_skills Не использованы поля: ''' } Table background_items { background_id int [pk, ref: > background.id] entity_id int [pk, ref: > entity.id, note: "{}.name"] level int [note: "{}.level"] // name string [note: "{}.name (?)"] Note: "{} = Item.background.system.items" } Table background_skills { id int [pk, increment] background_id int [not null, ref: > background.id] name varchar [not null, note: "{}.[]"] is_skill bool [not null, note: "true = [value] false = [lore]"] Note: "{} = Item.background.system.items.[lore|value]" } Table background_boosts { id int [pk, increment] background_id int [not null, ref: > background.id] value varchar(3) [null, note: "null = free boost (all 6 values in foundry)"] } // Campaign Feature Table campaign_feature { id int [pk, ref: - entity.id] level int [null, note: "{}.level"] type action_type [not null, note: "{}.actionType"] actions int [not null, note: "{}.actions"] category campaign_feature_category [not null, note: "{}.category"] prerequisites varchar [null, note: "{}.prerequisites.value.[0].value"] extra text [null, note: "json для того, что надо рассмотреть"] Note: '''{} = Item.campaignFeature.system Перенаправление: {}.publication -> entity_sources {}.traits -> entity_traits Рассмотреть: {}.prerequisites - очень странная структура, но, похоже, просто одиночное value Не использованы поля: {}.campaign - всегда "kingmaker" {}.requirements - всегда пустое {}.trigger - всегда пустое ''' } Enum campaign_feature_category { army_tactic // army-tactic army_war_action // army-war-action kingdom_activity // kingdom-activity kingdom_feat // kingdom-feat kingdom_feature // kingdom-feature } // Class Table class { id int [pk, ref: - entity.id] hp int [not null, note: "{}.hp"] perception int [not null, note: "{}.perception"] spellcasting bool [not null, note: "{}.spellcasting"] additionalTrainedSkills int [not null, note: "{}.trainedSkills.additional"] Note: '''{} = Item.class.system Перенаправление: {}.publication -> entity_sources {}.traits -> entity_traits {}.ancestryFeatLevels -> class_progression {}.classFeatLevels -> class_progression {}.generalFeatLevels -> class_progression {}.items -> class_progression {}.skillFeatLevels -> class_progression {}.skillIncreaseLevels -> class_progression {}.attacks.[!other] -> class_trainings {}.defenses -> class_trainings {}.savingThrows -> class_trainings {}.trainedSkills.[value|custom] -> class_trainings {}.keyAbility.value -> class_key_abilities ''' } Table class_key_abilities { id int [pk, increment] class_id int [not null, ref: > class.id] value varchar(3) [not null] } Table class_progression { id int [pk, increment] class_id int [not null, ref: > class.id] level int [not null] type class_progression_type [not null] entity_id int [null, ref: > entity.id] } Table class_trainings { id int [pk, increment] class_id int [not null, ref: > class.id] item int [null, ref: > trainings.id] name varchar [null, note: "{}.attacks.other"] stage int [not null, note: "0-untrained, 1-trained..."] } Enum class_progression_type { entity [note: "{}.system.items"] ancestry_feat [note: "{}.system.ancestryFeatLevels"] class_feat [note: "{}.system.classFeatLevels"] general_feat [note: "{}.system.generalFeatLevels"] skill_feat [note: "{}.system.skillFeatLevels"] skill_increase [note: "{}.system.skillIncreaseLevels"] } // Condition Table condition { id int [pk, ref: - entity.id] group condition_group [null, note: "{}.group"] extra text [null, note: "json для того, что надо рассмотреть"] Note: '''{} = Item.condition.system Перенаправление: {}.publication -> entity_sources {}.traits -> entity_traits Рассмотреть: {}.duration {}.overrides {}.references - всегда пустое {}.value Не использованы поля: ''' } Enum condition_group { senses abilities death attitudes detection } // Deity Table deity { id int [pk, ref: - entity.id] category deity_category [not null, note: "{}.category"] font deity_fonts [not null, note: "{}.font"] sanctification_must bool [not null, note: "{}.sanctification.modal"] sanctification_type deity_sanctification [not null, note: "{}.sanctification.what"] Note: '''{} = Item.deity.system Перенаправление: {}.publication -> entity_sources {}.traits -> entity_traits {}.attribute -> deity_attribute {}.skill -> deity_skills {}.spells -> deity_spells {}.weapons -> deity_weapons {}.domains -> deity_domains ''' } Table deity_attributes { deity_id int [pk, ref: > deity.id] attribute varchar(3) [pk] } Table deity_skills { deity_id int [pk, ref: > deity.id] skill_id int [pk, ref: > trainings.id] } Table deity_spells { id int [pk, increment] deity_id int [not null, ref: > deity.id] level int [not null] spell_id int [not null, ref: > spell.id] } Table deity_weapons { id int [pk, increment] deity_id int [not null, ref: > deity.id] weapon varchar [not null] } Table deity_domains { id int [pk, increment] deity_id int [not null, ref: > deity.id] is_primary bool [not null, note: "true = primary; false = alternate"] value varchar [not null] } Enum deity_category { deity pantheon covenant philosophy } Enum deity_fonts { none heal harm any } Enum deity_sanctification { holy unholy any } // Feat Table feat { id int [pk, ref: - entity.id] action_type feat_action_type [not null, note: "{}.actionType.value"] actions int [null, note: "{}.actions?.value"] category feat_category [not null, note: "{}.category"] level int [not null, note: "{}.level.value"] level_taken int [null, note: "{}.level.taken"] // Всего 2 значения: 1, 2 max_takable int [null, note: "{}.level.maxTakable"] location varchar(12) [null, note: "{}.level.location"] only_level_1 bool [null, note: "{}.onlyLevel1"] extra text [null, note: "json для того, что надо рассмотреть"] Note: '''{} = Item.feat.system Перенаправление: {}.publication -> entity_sources {}.traits -> entity_traits {}.frequency -> frequency {}.prerequisites -> feat_prerequisites Рассмотреть: {}.subfeatures {}.duration - только у одного {}.start - только у одного Не использованы поля: {}.subfeatures - пишем в описании пока что, потом подключение таблицы {}.actionCategory - всегда пустое {}.identified - всегда true {}.target - всегда null {}.selfEffect ''' } Enum feat_action_type { passive action reaction free } Enum feat_category { ancestryfeature classfeature calling class skill general ancestry bonus deityboon curse pfsboon } Table feat_prerequisites { id int [pk, increment] feat_id int [not null, ref: > feat.id] value varchar [not null, note: "{}.[].value"] Note: "{} = Item.feat.system.prerequisites.value" } // Heritage Table heritage { id int [pk, ref: - entity.id] ancestry_id int [null, ref: > ancestry.id] Note: '''{} = Item.heritage.system Перенаправление: {}.publication -> entity_sources {}.traits -> entity_traits ''' } // Spell Table spell { id int [pk, ref: - entity.id] level int [not null, note: "{}.level"] cost int [not null, note: "{}.cost"] counteraction bool [not null, note: "{}.counteraction"] sustained bool [not null, note: "{}.duration.sustained"] duration varchar [not null, note: "{}.duration.value"] range varchar [not null, note: "{}.range.value"] requirements varchar [not null, note: "{}.requirements"] target varchar [not null, note: "{}.target.value"] time varchar [not null, note: "{}.time.value"] can_heightening bool [not null, note: "{}.heightening != null"] Note: '''{} = Item.spell.system Перенаправление: {}.publication -> entity_sources {}.traits -> entity_traits {}.area -> spell_area {}.damage -> spell_damage {}.ritual -> spell_ritual {}.defense -> spell_defense Не использованы поля: {}.heightening {}.overlays ''' } Table spell_area { spell_id int [pk, ref: - spell.id] details varchar [null, note: "{}.details"] type spell_area_type [not null, note: "{}.type"] value int [not null, note: "{}.value"] Note: "{} = Item.spell.system.area" } Table spell_damage { id int [pk, increment] spell_id int [not null, ref: > spell.id] key varchar [not null, note: "{}.[key]"] apply_mod bool [null, note: "{}.[value].applyMod"] category spell_damage_category [null, note: "{}.[value].category"] formula varchar [not null, note: "{}.[value].formula"] kinds spell_damage_kinds [not null, note: "{}.[value].kinds"] materials varchar [null, note: "{}.[value].materials"] type varchar [not null, note: "{}.[value].type"] Note: "{} = Item.spell.system.damage" } Table spell_ritual { spell_id int [pk, ref: - spell.id] primary_check varchar [not null, note: "{}.primary.check"] secondary_casters int [not null, note: "{}.secondary.casters"] secondary_checks varchar [not null, note: "{}.secondary.checks"] Note: "{} = Item.spell.system.ritual" } Table spell_defense { id int [pk, increment] spell_id int [not null, ref: > spell.id] is_passive bool [not null, note: "true = {}.passive; true = {}.save"] is_basic bool [null, note: "{}.save?.basic"] statistic varchar [not null, note: "{}.[save|passive].statistic"] Note: "{} = Item.spell.system.defense" } Enum spell_area_type { burst emanation cone line square cube cylinder } Enum spell_damage_category { persistent splash } Enum spell_damage_kinds { damage healing any } // effect??? /* Table template { id int [pk, ref: - entity.id] extra text [null, note: "json для того, что надо рассмотреть"] Note: '''{} = Item..system Перенаправление: {}.publication -> entity_sources {}.traits -> entity_traits Рассмотреть: Не использованы поля: ''' } */