Исправление схемы

This commit is contained in:
2025-04-11 15:57:10 +04:00
parent 46927ab3d2
commit b925866bba
2 changed files with 206 additions and 189 deletions
+112
View File
@@ -0,0 +1,112 @@
// -----------------------------------------------------------
// 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"]
extra text [null, note: "json для того, что надо рассмотреть"]
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"]
extra text [null, note: "json для того, что надо рассмотреть"]
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
+92 -187
View File
@@ -2,31 +2,42 @@
// Entity
Table entity {
id int [pk]
id int [pk, increment]
name varchar [not null, note: "{*}.name"]
img varchar(100) [note: "{*}.img"]
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]
slug varchar
rarity entity_rarity [not null, default: "common", note: "{*}.system.rarity"]
slug varchar [not null]
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 [ref: > entity.id]
entity_id int [not null, ref: > entity.id]
alias varchar [not null]
type alias_type [not null]
}
@@ -46,48 +57,50 @@ Table entity_keywords {
keyword_id int [ref: > keyword.id]
}
Table keyword_aliases {
keyword_id int [pk, ref: keyword.id]
keyword_id int [pk, ref: > keyword.id]
type alias_type [pk]
value varchar
value varchar [not null]
}
// Sources
Table source {
id int [pk, increment]
name varchar
url varchar
name varchar [not null]
url varchar [not null]
}
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: "Для контроля обновлений"]
suffix varchar [not null, default: "", note: "страница и проч."]
is_remaster bool [not null]
}
// External links
Table external_target {
id int
name varchar
icon varchar
id int [pk, increment]
name varchar [not null]
icon varchar [not null]
}
Table entity_external {
entity_id int [ref: > entity.id]
target_id int [ref: > external_target.id]
path varchar
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]
id int [pk, increment]
name varchar [not null]
description text
type trait_type
description text [not null]
type trait_type [not null]
}
Table entity_traits {
entity_id int [ref: > entity.id]
trait_id int [ref: > trait.id]
entity_id int [pk, ref: > entity.id]
trait_id int [pk, ref: > trait.id]
}
Enum trait_type {
regular
@@ -107,24 +120,19 @@ Table 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
id int [pk, increment]
name varchar [not null]
rarity entity_rarity [not null]
}
// Trainings
Table trainings {
id int [pk]
key varchar
id int [pk, increment]
key varchar [not null]
Note: "Текстовые записи - в глоссарии"
}
// ----------------------------------------------
@@ -138,6 +146,8 @@ Table action {
category action_category [null, note: "{}.category"] // Нет у 81 объекта
death_note bool [null, note: "{}.deathNote"]
extra text [null, note: "json для того, что надо рассмотреть"]
Note: '''{} = Item.action.system
Перенаправление:
@@ -205,7 +215,7 @@ Table ancestry_languages {
}
Table ancestry_boosts {
id int [pk, increment]
ancestry_id int [ref: > ancestry.id]
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)"]
}
@@ -233,8 +243,8 @@ Table background {
}
Table background_items {
id int [pk]
background_id int [ref: > background.id]
entity_id int [ref: > entity.id, note: "{}.name"]
background_id int [not null, ref: > background.id]
entity_id int [not null, ref: > entity.id, note: "{}.name"]
level int [note: "{}.level"]
// name string [note: "{}.name (?)"]
@@ -242,17 +252,17 @@ Table background_items {
Note: "{} = Item.background.system.items"
}
Table background_skills {
id int [pk]
background_id int [ref: > background.id]
id int [pk, increment]
background_id int [not null, ref: > background.id]
name varchar [note: "{}.[]"]
is_skill bool [note: "true = [value] false = [lore]"]
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 [ref: > background.id]
background_id int [not null, ref: > background.id]
value varchar(3) [null, note: "null = free boost (all 6 values in foundry)"]
}
@@ -263,11 +273,11 @@ Table campaign_feature {
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"]
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
@@ -297,10 +307,10 @@ Enum campaign_feature_category {
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"]
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
@@ -324,25 +334,25 @@ Table class {
'''
}
Table class_key_abilities {
id int [pk]
class_id int [ref: > class.id]
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 [ref: > class.id]
level int
type class_progression_type
entity_id [null, ref: > entity.id]
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 [ref: > class.id]
class_id int [not null, ref: > class.id]
item int [null, ref: > trainings.id]
name varchar [null, note: "{}.attacks.other"]
stage: int [note: "0-untrained, 1-trained..."]
stage int [not null, note: "0-untrained, 1-trained..."]
}
Enum class_progression_type {
entity [note: "{}.system.items"]
@@ -359,6 +369,8 @@ Table condition {
group condition_group [null]
extra text [null, note: "json для того, что надо рассмотреть"]
Note: '''{} = Item.condition.system
Перенаправление:
@@ -411,18 +423,18 @@ Table deity_attributes {
}
Table deity_skills {
deity_id int [pk, ref: > deity.id]
skill_id trainings [pk, ref: > trainings.id]
skill_id int [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]
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 [ref: > deity.id]
weapon varchar
deity_id int [not null, ref: > deity.id]
weapon varchar [not null]
}
Table deity_domains {
id int [pk, increment]
@@ -514,12 +526,11 @@ Table feat_prerequisites {
Note: "{} = Item.feat.system.prerequisites.value"
}
// Heritage
Table heritage {
id int [pk, ref: - entity.id]
ancestry_id [null, ref: > ancestry.id]
ancestry_id int [null, ref: > ancestry.id]
Note: '''{} = Item.heritage.system
@@ -533,17 +544,17 @@ Table heritage {
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"]
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 [note: "{}.heightening != null"]
can_heightening bool [not null, note: "{}.heightening != null"]
Note: '''{} = Item.spell.system
@@ -588,9 +599,9 @@ Table spell_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"]
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"
}
@@ -631,6 +642,8 @@ Enum spell_damage_kinds {
Table template {
id int [pk, ref: - entity.id]
extra text [null, note: "json для того, что надо рассмотреть"]
Note: '''{} = Item..system
Перенаправление:
@@ -643,111 +656,3 @@ Table template {
'''
}
*/
// -----------------------------------------------------------
// 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