604 lines
15 KiB
Plaintext
604 lines
15 KiB
Plaintext
// 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]
|
||
}
|
||
|
||
// Sources
|
||
TableGroup source_group {
|
||
source
|
||
entity_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: ""]
|
||
}
|
||
|
||
// External links
|
||
TableGroup external_group {
|
||
external_target
|
||
entity_external
|
||
}
|
||
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
|
||
TableGroup trait_group {
|
||
trait
|
||
entity_traits
|
||
}
|
||
Table trait {
|
||
id int [pk]
|
||
name varchar [not null]
|
||
description text
|
||
}
|
||
Table entity_traits {
|
||
entity_id int [ref: > entity.id]
|
||
trait_id int [ref: > trait.id]
|
||
}
|
||
|
||
// ----------------------------------------------
|
||
|
||
// Action
|
||
Table action {
|
||
id int [pk, ref: - entity.id]
|
||
|
||
type action_type [not null, note: "{}.system.actionType.value"]
|
||
actions int [null, note: "{}.system.actions?.value"]
|
||
category action_category [null, note: "{}.system.category"] // Нет у 81 объекта
|
||
death_note bool [null, note: "{}.system.deathNote"]
|
||
|
||
Note: '''{} = Item.action
|
||
|
||
Перенаправление:
|
||
{}.system.publication -> entity_sources
|
||
{}.system.traits -> entity_traits
|
||
|
||
{}.system.frequency -> ??? Возможно нужно на общую frequency
|
||
|
||
Рассмотреть:
|
||
{}.system.selfEffect
|
||
{}.system.duration
|
||
{}.system.start - .value всегда 103462347
|
||
{}.system.target
|
||
|
||
Не использованы поля:
|
||
{}.system.subfeatures - пишем в описании пока что, потом подключение таблицы
|
||
{}.system.actionCategory - всегда пробел???
|
||
'''
|
||
}
|
||
Enum action_type {
|
||
action
|
||
free
|
||
reaction
|
||
passive
|
||
}
|
||
Enum action_category {
|
||
offensive
|
||
defensive
|
||
interaction
|
||
familiar
|
||
}
|
||
|
||
// Ancestery
|
||
Table ancestry {
|
||
id int [pk, ref: - entity.id]
|
||
|
||
hp int [not null, note: "{}.system.hp"]
|
||
reach int [not null, note: "{}.system.reach"]
|
||
size ancestry_size [not null, note: "{}.system.size"]
|
||
speed int [not null, note: "{}.system.speed"]
|
||
vision ancestry_vision [not null, note: "{}.system.vision"]
|
||
|
||
Note: '''{} = Item.ancestry
|
||
|
||
Перенаправление:
|
||
{}.system.publication -> entity_sources
|
||
{}.system.traits -> entity_traits
|
||
|
||
Рассмотреть:
|
||
{}.system.boosts
|
||
{}.system.flaws
|
||
{}.system.items - TODO добавить в определение dict-типа
|
||
{}.system.lanuages
|
||
|
||
Не использованы поля:
|
||
{}.system.additionalLanguages
|
||
'''
|
||
}
|
||
Enum ancestry_size {
|
||
med
|
||
lanuages
|
||
system
|
||
tiny
|
||
}
|
||
Enum ancestry_vision {
|
||
normal
|
||
low_light_vision // low-light-vision
|
||
darkvision
|
||
}
|
||
|
||
// Armor
|
||
Table armor {
|
||
id int [pk, ref: - entity.id]
|
||
|
||
ac_bonus int [not null, note: "{}.system.acBonus"]
|
||
strength int [null, note: "{}.system.strength"]
|
||
check_penalty int [not null, note: "{}.system.checkPenalty"]
|
||
dex_cap int [not null, note: "{}.system.dexCap"]
|
||
speed_penalty int [not null, note: "{}.system.speedPenalty"]
|
||
|
||
bulk float [not null, note: "{}.system.bulk"]
|
||
category armor_category [not null, note: "{}.system.category"]
|
||
group armor_group [null, note: "{}.system.group"] // 16 без группы
|
||
level int [not null, note: "{}.system.level.value"]
|
||
price int [not null, note: "price({}.system.price.value)"]
|
||
size armor_size [not null, note: "{}.system.size"]
|
||
|
||
Note: '''{} = Item.armor
|
||
|
||
Перенаправление:
|
||
{}.system.publication -> entity_sources
|
||
{}.system.traits -> entity_traits
|
||
|
||
Рассмотреть:
|
||
{}.system.base_item - возможно связь на себя
|
||
{}.system.material
|
||
{}.system.runes
|
||
{}.system.specific
|
||
|
||
Не использованы поля:
|
||
{}.system.containerId - пустое
|
||
{}.system.hardness - всегда 0
|
||
{}.system.hp - всегда 0
|
||
{}.system.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
|
||
}
|
||
|
||
// Background
|
||
Table background {
|
||
id int [pk, ref: - entity.id]
|
||
|
||
Note: '''{} = Item.background
|
||
|
||
Перенаправление:
|
||
{}.system.publication -> entity_sources
|
||
{}.system.traits -> entity_traits
|
||
{}.system.items -> background_items
|
||
{}.system.trainedSkills -> background_skills
|
||
|
||
Рассмотреть:
|
||
{}.system.boosts
|
||
|
||
Не использованы поля:
|
||
'''
|
||
}
|
||
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]"
|
||
}
|
||
|
||
// Backpack
|
||
Table backpack {
|
||
id int [pk, ref: - entity.id]
|
||
|
||
level int [note: "{}.system.bulk.level.value"]
|
||
|
||
capacity int [note: "{}.system.bulk.heldOrStowed"]
|
||
heldOrStowed float [note: "{}.system.bulk.heldOrStowed"]
|
||
ignored int [note: "{}.system.bulk.ignored"]
|
||
value float [note: "{}.system.bulk.value"]
|
||
hardness int [note: "{}.system.bulk.hardness"]
|
||
quantity int [note: "{}.system.bulk.quantity"]
|
||
|
||
price int [note: "price({}.system.price.value)"]
|
||
size varchar [note: "{}.system.bulk.size (always med)"]
|
||
stowing bool [note: "{}.system.stowing"]
|
||
usage
|
||
|
||
Note: '''{} = Item.backpack
|
||
|
||
Перенаправление:
|
||
{}.system.publication -> entity_sources
|
||
{}.system.traits -> entity_traits
|
||
|
||
Рассмотреть:
|
||
{}.system.material
|
||
|
||
Не использованы поля:
|
||
{}.system.collapsed - всегда false
|
||
'''
|
||
}
|
||
Enum backpack_usage {
|
||
wornbackpack
|
||
held_in_two_hands // held-in-two-hands
|
||
worn
|
||
held_in_one_hand // held-in-one-hand
|
||
worngarment
|
||
}
|
||
|
||
// Campaign Feature
|
||
Table campaign_feature {
|
||
id int [pk, ref: - entity.id]
|
||
|
||
level int [note: "{}.system.level"]
|
||
|
||
type action_type [note: "{}.system.actionType"]
|
||
action int [note: "{}.system.actions"]
|
||
category campaign_feature_category [note: "{}.system.category"]
|
||
|
||
|
||
Note: '''{} = Item.campaignFeature
|
||
|
||
Перенаправление:
|
||
{}.system.publication -> entity_sources
|
||
{}.system.traits -> entity_traits
|
||
|
||
Рассмотреть:
|
||
{}.system.prerequisites - очень странная структура,
|
||
но, похоже, просто одиночное value
|
||
|
||
Не использованы поля:
|
||
{}.system.requirements - всегда пустое
|
||
{}.system.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: "{}.system.hp"]
|
||
perception int [note: "{}.system.perception"]
|
||
spellcasting bool [note: "{}.system.spellcasting"]
|
||
|
||
Note: '''{} = Item.class
|
||
|
||
Перенаправление:
|
||
{}.system.publication -> entity_sources
|
||
{}.system.traits -> entity_traits
|
||
|
||
{}.system.ancestryFeatLevels -> class_progression
|
||
{}.system.classFeatLevels -> class_progression
|
||
{}.system.generalFeatLevels -> class_progression
|
||
{}.system.items -> class_progression
|
||
{}.system.skillFeatLevels -> class_progression
|
||
{}.system.skillIncreaseLevels -> class_progression
|
||
|
||
{}.system.attacks.[!other] -> class_trainings
|
||
{}.system.defenses -> class_trainings
|
||
{}.system.savingThrows -> class_trainings
|
||
|
||
|
||
Рассмотреть:
|
||
{}.system.keyAbility
|
||
{}.system.attacks.other
|
||
|
||
Не использованы поля:
|
||
'''
|
||
}
|
||
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 varchar [note: "Возможно нужна связь с чем-то ещё"]
|
||
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
|
||
|
||
Note: '''{} = Item.condition
|
||
|
||
Перенаправление:
|
||
{}.system.publication -> entity_sources
|
||
{}.system.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
|
||
|
||
|
||
Note: '''{} = Item.deity
|
||
|
||
Перенаправление:
|
||
{}.system.publication -> entity_sources
|
||
{}.system.traits -> entity_traits
|
||
|
||
attribute -> deity_attribute
|
||
skill -> deity_skills
|
||
spells -> deity_spells
|
||
weapons -> deity_weapons
|
||
|
||
Рассмотреть:
|
||
domains - нужная другая таблица?
|
||
font
|
||
sanctification
|
||
|
||
Не использованы поля:
|
||
'''
|
||
}
|
||
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 varchar [pk]
|
||
}
|
||
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
|
||
}
|
||
Enum deity_category {
|
||
deity
|
||
pantheon
|
||
covenant
|
||
philosophy
|
||
}
|
||
|
||
// Feat
|
||
Table feat {
|
||
id int [pk, ref: - entity.id]
|
||
|
||
action_type feat_action_type [note: "{}.system.actionType.value"]
|
||
actions int [null, note: "{}.system.actions?.value"]
|
||
category feat_category [not null, note: "{}.system.category"]
|
||
level int [not null, note: "{}.system.level.value"]
|
||
level_taker int [null, note: "{}.system.level.taken"] // Всего 2 значения: 1, 2
|
||
max_takable int [null, note: "{}.system.level.maxTakable"]
|
||
location varchar(12) [null, note: "{}.system.level.location"]
|
||
only_level_1 bool [null, note: "{}.system.onlyLevel1"]
|
||
|
||
Note: '''{} = Item.feat
|
||
|
||
Перенаправление:
|
||
{}.system.publication -> entity_sources
|
||
{}.system.traits -> entity_traits
|
||
{}.system.frequency -> feat_frequency
|
||
|
||
Рассмотреть:
|
||
{}.system.prerequisites
|
||
{}.system.selfEffect
|
||
{}.system.duration
|
||
{}.system.start - .value всегда 103462347
|
||
{}.system.target
|
||
|
||
Не использованы поля:
|
||
{}.system.subfeatures - пишем в описании пока что, потом подключение таблицы
|
||
{}.system.actionCategory - всегда пробел???
|
||
'''
|
||
}
|
||
Enum feat_action_type {
|
||
passive
|
||
action
|
||
reaction
|
||
free
|
||
}
|
||
Enum feat_category {
|
||
ancestryfeature
|
||
classfeature
|
||
calling
|
||
class
|
||
skill
|
||
general
|
||
ancestry
|
||
bonus
|
||
deityboon
|
||
curse
|
||
pfsboon
|
||
}
|
||
Table feat_frequency {
|
||
feat_id int [pk, ref: > feat.id]
|
||
max int [not null, note: "{Item.feat}.system.frequency.max"]
|
||
per int [not null, note: "{Item.feat}.system.frequency.per"]
|
||
value int [null, note: "{Item.feat}.system.frequency.value - что это вообще?!"]
|
||
}
|
||
|
||
// Heritage
|
||
Table heritage {
|
||
id int [pk, ref: - entity.id]
|
||
|
||
ancestry_id [null, ref: > ancestry.id]
|
||
|
||
Note: '''{} = Item.heritage
|
||
|
||
Перенаправление:
|
||
{}.system.publication -> entity_sources
|
||
{}.system.traits -> entity_traits
|
||
|
||
Рассмотреть:
|
||
|
||
Не использованы поля:
|
||
'''
|
||
}
|
||
|
||
// Spell
|
||
Table spell {
|
||
id int [pk, ref: - entity.id]
|
||
|
||
cost int [note: "{}.system.cost"]
|
||
|
||
Note: '''{} = Item.spell
|
||
|
||
Перенаправление:
|
||
{}.system.publication -> entity_sources
|
||
{}.system.traits -> entity_traits
|
||
|
||
Рассмотреть:
|
||
|
||
Не использованы поля:
|
||
'''
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
/*
|
||
Table template {
|
||
id int [pk, ref: - entity.id]
|
||
|
||
Note: '''{} = Item.
|
||
|
||
Перенаправление:
|
||
{}.system.publication -> entity_sources
|
||
{}.system.traits -> entity_traits
|
||
|
||
Рассмотреть:
|
||
|
||
Не использованы поля:
|
||
'''
|
||
}
|
||
*/
|
||
|
||
// consumable -> equipment?
|
||
// effect???
|
||
// equipment
|
||
// kit
|
||
// shield -> equipment |