Files
Pf2eDataScrapper/dbml/schema.dbml
T

753 lines
19 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// https://dbml.dbdiagram.io/docs
// Entity
Table entity {
id int [pk]
name varchar [not null, note: "{*}.name"]
img varchar(100) [note: "{*}.img"]
description text [not null, note: "{*}.system.description(.value)"]
description_gm text [null, note: "{*}.system.description.gm"]
type entity_type [not null]
slug varchar
rarity entity_rarity [not null, default: "common", note: "{*}.system.rarity"]
is_translated bool [default: false, note: "Первичный импорт идёт из англоязычного источника, перевод приходит вторым"]
is_checked bool [default: false, note: "Флаг, указывающий, что перевод был проверен вручную и не требует обновления парсером"]
}
Enum entity_type {
feat
}
Enum entity_rarity {
common
uncommon
rare
}
// Alias
Table entity_aliases {
id int [pk, increment]
entity_id int [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 [ref: > entity.id]
keyword_id int [ref: > keyword.id]
}
Table keyword_aliases {
keyword_id int [pk, ref: keyword.id]
type alias_type [pk]
value varchar
}
// Sources
Table source {
id int [pk, increment]
name varchar
url varchar
}
Table entity_sources {
entity_id int [ref: > entity.id]
source_id int [ref: > source.id]
suffix varchar [default: "", note: "Для источников Foundry - полный UUID объекта"]
md5 varchar [not null, note: "Для контроля обновлений"]
}
// External links
Table external_target {
id int
name varchar
icon varchar
}
Table entity_external {
entity_id int [ref: > entity.id]
target_id int [ref: > external_target.id]
path varchar
}
// ----------------------------------------------
// Traits
Table trait {
id int [pk]
name varchar [not null]
description text
type trait_type
}
Table entity_traits {
entity_id int [ref: > entity.id]
trait_id int [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}'''
}
// Duration
Table duration {
id int [pk, ref: - entity.id]
}
// Languages
Table language {
id int [pk]
name varchar
rarity entity_rarity
}
// Trainings
Table trainings {
id int [pk]
key varchar
}
// ----------------------------------------------
// 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"]
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 [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 {
id int [pk]
background_id int [ref: > background.id]
entity_id int [ref: > entity.id, note: "{}.name"]
level int [note: "{}.level"]
// name string [note: "{}.name (?)"]
Note: "{} = Item.background.system.items"
}
Table background_skills {
id int [pk]
background_id int [ref: > background.id]
name varchar [note: "{}.[]"]
is_skill bool [note: "true = [value] false = [lore]"]
Note: "{} = Item.background.system.items.[lore|value]"
}
Table background_boosts {
id int [pk, increment]
background_id int [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 [note: "{}.actions"]
category campaign_feature_category [note: "{}.category"]
prerequisites varchar [null, note: "{}.prerequisites"]
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 [note: "{}.hp"]
perception int [note: "{}.perception"]
spellcasting bool [note: "{}.spellcasting"]
additionalTrainedSkills int [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]
class_id int [ref: > class.id]
value varchar(3) [not null]
}
Table class_progression {
id int [pk, increment]
class_id int [ref: > class.id]
level int
type class_progression_type
entity_id [null, ref: > entity.id]
}
Table class_trainings {
id int [pk, increment]
class_id int [ref: > class.id]
item int [null, ref: > trainings.id]
name varchar [null, note: "{}.attacks.other"]
stage: int [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: '''{} = 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 trainings [pk, ref: > trainings.id]
}
Table deity_spells {
id int [pk, increment]
deity_id int [ref: > deity.id]
level int
spell_id int [ref: > spell.id]
}
Table deity_weapons {
id int [pk, increment]
deity_id int [ref: > deity.id]
weapon varchar
}
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 [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 [note: "{}.level"]
cost int [note: "{}.cost"]
counteraction bool [note: "{}.counteraction"]
sustained bool [note: "{}.duration.sustained"]
duration varchar [note: "{}.duration.value"]
range varchar [note: "{}.range.value"]
requirements varchar [note: "{}.requirements"]
target varchar [note: "{}.target.value"]
time varchar [note: "{}.time.value"]
can_heightening bool [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 [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 [note: "{}.primary.check"]
secondary_casters int [note: "{}.secondary.casters"]
secondary_checks varchar [note: "{}.secondary.checks"]
Note: "{} = Item.spell.system.ritual"
}
Table spell_defense {
id int [pk, increment]
spell_id int [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]
Note: '''{} = Item..system
Перенаправление:
{}.publication -> entity_sources
{}.traits -> entity_traits
Рассмотреть:
Не использованы поля:
'''
}
*/
// -----------------------------------------------------------
// Armor
Table armor {
id int [pk, ref: - entity.id]
ac_bonus int [not null, note: "{}.acBonus"]
strength int [null, note: "{}.strength"]
check_penalty int [not null, note: "{}.checkPenalty"]
dex_cap int [not null, note: "{}.dexCap"]
speed_penalty int [not null, note: "{}.speedPenalty"]
bulk float [not null, note: "{}.bulk"]
category armor_category [not null, note: "{}.category"]
group armor_group [null, note: "{}.group"] // 16 без группы
level int [not null, note: "{}.level.value"]
price int [not null, note: "price({}.price.value)"]
size armor_size [not null, note: "{}.size"]
Note: '''{} = Item.armor.system
Перенаправление:
{}.publication -> entity_sources
{}.traits -> entity_traits
Рассмотреть:
{}.base_item - возможно связь на себя
{}.material
{}.runes
{}.specific
Не использованы поля:
{}.containerId - пустое
{}.hardness - всегда 0
{}.hp - всегда 0
{}.quantity - всегда 1
'''
}
Enum armor_category {
light
heavy
medium
light_barding // light-barding
heavy_barding // heavy-barding
unarmored
}
Enum armor_group {
leather
plate
wood
chain
cloth
skeletal
composite
}
Enum armor_size {
med
lg
}
// Backpack
Table backpack {
id int [pk, ref: - entity.id]
level int [note: "{}.bulk.level.value"]
capacity int [note: "{}.bulk.heldOrStowed"]
heldOrStowed float [note: "{}.bulk.heldOrStowed"]
ignored int [note: "{}.bulk.ignored"]
value float [note: "{}.bulk.value"]
hardness int [note: "{}.bulk.hardness"]
quantity int [note: "{}.bulk.quantity"]
price int [note: "price({}.price.value)"]
size varchar [note: "{}.bulk.size (always med)"]
stowing bool [note: "{}.stowing"]
usage
Note: '''{} = Item.backpack.system
Перенаправление:
{}.publication -> entity_sources
{}.traits -> entity_traits
Рассмотреть:
{}.material
Не использованы поля:
{}.collapsed - всегда false
'''
}
Enum backpack_usage {
wornbackpack
held_in_two_hands // held-in-two-hands
worn
held_in_one_hand // held-in-one-hand
worngarment
}
// consumable -> equipment?
// equipment
// kit -> equipment
// shield -> equipment
// treasure -> equipment
// weapon -> equipment