squash merge: partially did arbiter data

This commit is contained in:
jrmiller82 committed 2019-08-25 22:33:15 -05:00
1 parent 6b61fd6883
commit b3b0967cb3
8 files changed
+108 -44

No files matched your search

+41 -36
View File
@@ -13,17 +13,15 @@ PRAGMA foreign_keys = ON;
-- all with traits. Thoughts?
CREATE TABLE monsters (
monsters_id INTEGER PRIMARY KEY,
monster_id INTEGER PRIMARY KEY,
is_comty_use BOOLEAN NOT NULL, -- false = no community use policy req
sources_id INTEGER, -- old style source entries
sources_pages TEXT, -- old style source entries
sourceentries_id INTEGER, -- new style source entries
sourceentry_id INTEGER, -- new style source entries
-- monstercategories_id INTEGER, -- Humanoid etc..
"name" TEXT NOT NULL UNIQUE,
"level" INTEGER,
alignment_id INTEGER, -- i.e. NG, LE etc..
perception INTEGER,
sizes_id INTEGER, -- i.e. large medium small etc..
size_id INTEGER, -- i.e. large medium small etc..
ac INTEGER,
fortitude INTEGER,
reflex INTEGER,
@@ -41,24 +39,18 @@ CREATE TABLE monsters (
int_mod INTEGER,
wis_mod INTEGER,
cha_mod INTEGER,
descr TEXT, -- The idea with this is for this to hold the entire stat block
-- text in it for those that want to do a simple query. I DO
-- intend to break out all the actions etc. into a separate table
-- and do many-to-many joins. Yes, this duplicates some data but
-- this is more for getting markdown formatting of the stat block
-- in one nice column.
FOREIGN KEY (alignments_id) REFERENCES alignments(alignments_id),
FOREIGN KEY (sizes_id) REFERENCES sizes(sizes_id),
FOREIGN KEY (sources_id) REFERENCES sources(sources_id),
FOREIGN KEY (sourceentries_id) REFERENCES sourceentries(sourceentries_id)
specific_monster_flavortext TEXT,
FOREIGN KEY (alignment_id) REFERENCES alignments(alignments_id),
FOREIGN KEY (size_id) REFERENCES sizes(size_id),
FOREIGN KEY (sourceentry_id) REFERENCES sourceentries(sourceentry_id)
);
CREATE TABLE monsterflavortexttypes (
monsterflavortexttypes_id INTEGER PRIMARY KEY,
monsterflavortexttype_id INTEGER PRIMARY KEY,
"name" TEXT NOT NULL UNIQUE
-- page 7 Bestiary
-- 'Monster Category' -- i.e. "Bear"
-- 'Specific Monster' -- i.e. "Grizzly Bear"
-- THE FOLLOWING ARE THE SIDEBAR CONTENT FROM BESTIARY
-- 'Advice and Rules'
-- 'Related Creatures'
-- 'Additional Lore'
@@ -67,19 +59,27 @@ CREATE TABLE monsterflavortexttypes (
);
CREATE TABLE monsterflavortexts (
monsterflavortexts_id INTEGER PRIMARY KEY,
monsterflavortexttypes_id INTEGER,
monsterflavortext_id INTEGER PRIMARY KEY,
monsterflavortexttype_id INTEGER,
heading TEXT NOT NULL,
mft_text TEXT NOT NULL,
FOREIGN KEY (monsterflavortexttypes_id) REFERENCES monsterflavortexttypes(monsterflavortexttype_id)
FOREIGN KEY (monsterflavortexttype_id) REFERENCES monsterflavortexttypes(monsterflavortexttype_id)
);
CREATE TABLE monsters_monsterflavortexts (
id INTEGER PRIMARY KEY,
monster_id,
monsterflavortext_id,
FOREIGN KEY (monster_id) REFERENCES monsters(monster_id),
FOREIGN KEY (monsterflavortext_id) REFERENCES monsterflavortexts(monsterflavortext_id)
);
CREATE TABLE monsters_senses (
id INTEGER PRIMARY KEY,
monsters_id INTEGER NOT NULL,
immunities_id INTEGER NOT NULL,
FOREIGN KEY (monsters_id) REFERENCES monsters(monsters_id),
FOREIGN KEY (senses_id) REFERENCES senses(senses_id)
monster_id INTEGER NOT NULL,
sense_id INTEGER NOT NULL,
FOREIGN KEY (monster_id) REFERENCES monsters(monster_id),
FOREIGN KEY (sense_id) REFERENCES senses(senses_id)
);
CREATE TABLE monsters_immunities (
@@ -92,33 +92,38 @@ CREATE TABLE monsters_immunities (
CREATE TABLE monsters_skills (
id INTEGER PRIMARY KEY,
monsters_id INTEGER NOT NULL,
monster_id INTEGER NOT NULL,
skills_id INTEGER NOT NULL, -- will ID the specific skill
skill_mod INTEGER NOT NULL, -- will hold the modifier value
UNIQUE(monsters_id, skills_id), -- so we don't get duplicate rows for a specific monster
FOREIGN KEY (monsters_id) REFERENCES monsters(monsters_id),
UNIQUE(monster_id, skills_id), -- so we don't get duplicate rows for a specific monster
FOREIGN KEY (monster_id) REFERENCES monsters(monster_id),
FOREIGN KEY (skills_id) REFERENCES skills(skills_id)
);
CREATE TABLE monsters_traits (
id INTEGER PRIMARY KEY,
monsters_id INTEGER NOT NULL,
monster_id INTEGER NOT NULL,
trait_id INTEGER NOT NULL,
FOREIGN KEY (monsters_id) REFERENCES monsters(monsters_id),
FOREIGN KEY (traits_id) REFERENCES traits(trait_id)
FOREIGN KEY (monster_id) REFERENCES monsters(monster_id),
FOREIGN KEY (trait_id) REFERENCES traits(trait_id)
);
CREATE TABLE monsters_langs (
id INTEGER PRIMARY KEY,
monster_id INTEGER NOT NULL,
lang_id INTEGER NOT NULL,
FOREIGN KEY (monster_id) REFERENCES monsters(monster_id),
FOREIGN KEY (lang_id) REFERENCES langs(lang_id)
);
-- TODO does this need to be separate table for monsters only or share the main
-- actions table
CREATE TABLE monsteractions (
monsteractions_id INTEGER PRIMARY KEY,
"name" TEXT,
monsteraction_id INTEGER PRIMARY KEY,
"name" TEXT
-- TODO
);
CREATE TABLE monsters_actions (
id INTEGER PRIMARY KEY,
monsters_id INTEGER NOT NULL,
actions_id INTEGER NOT NULL, -- TODO actions table? or monsteractions table?
monster_id INTEGER NOT NULL,
monsteraction_id INTEGER NOT NULL
);
+1 -1
View File
@@ -7,6 +7,6 @@ CREATE TABLE senses (
sources_id INTEGER,
sources_pages TEXT,
short_name TEXT NOT NULL UNIQUE,
description TEXT NOT NULL,
description TEXT,
FOREIGN KEY (sources_id) REFERENCES sources(sources_id)
);
+5 -5
View File
@@ -16,7 +16,7 @@ CREATE TABLE sources (
);
CREATE TABLE sourceentries (
sourceentries_id INTEGER PRIMARY KEY,
sourceentry_id INTEGER PRIMARY KEY,
sources_id INTEGER NOT NULL,
page_start INTEGER,
page_stop INTEGER,
@@ -26,10 +26,10 @@ CREATE TABLE sourceentries (
CREATE TABLE monsters_sourceentries (
id INTEGER PRIMARY KEY,
monsters_id INTEGER NOT NULL,
sourceentries_id INTEGER NOT NULL,
FOREIGN KEY (monsters_id) REFERENCES monsters(monsters_id),
FOREIGN KEY (sourceentries_id) REFERENCES sourceentries(sourceentries_id)
monster_id INTEGER NOT NULL,
sourceentry_id INTEGER NOT NULL,
FOREIGN KEY (monster_id) REFERENCES monsters(monster_id),
FOREIGN KEY (sourceentry_id) REFERENCES sourceentries(sourceentry_id)
);
-- TODO add in new many-to-many tables for the various things we want to have sources be listed this way