diff --git a/data/langs.sql b/data/langs.sql index 7d7b15e..592bf0d 100644 --- a/data/langs.sql +++ b/data/langs.sql @@ -1,6 +1,6 @@ -- -*- mode:sql sql-product:sqlite -*- -INSERT INTO langsrarity (rarirty_id, rarity_name) +INSERT INTO langsrarity (rarity_id, rarity_name) VALUES (1, 'Common'), (2, 'Uncommon'), @@ -9,32 +9,32 @@ VALUES -- TODO These values are from Tables 2-1, 2-2, and 2-3 on page 65 CRB -INSERT INTO langs (lang_id, rarity_id, lang, speakers) +INSERT INTO langs (lang_id, rarity_id, sources_id, sources_pages, lang, speakers) VALUES -- Common languages - (1, 1, 'Common', 'Humans, dwarves, elves, halflings, and other common ancestries'), - (2, 1, 'Draconic', 'Dragons, reptilian humanoids'), - (3, 1, 'Dwarven', 'Dwarves'), - (4, 1, 'Elven', 'Elves, half-elves'), - (5, 1, 'Gnomish', 'Gnomes'), - (6, 1, 'Goblin', 'Goblins, hobgoblins, bugbears'), - (7, 1, 'Halfling', 'Halflings'), - (8, 1, 'Jotun', 'Giants, ogres, trolls, ettins, cyclopes'), - (9, 1, 'Orcish', 'Orcs, half-orcs'), - (10, 1, 'Sylvan', 'Fey, centaurs, plant creatures'), - (11, 1, 'Undercommon', 'Drow, duergars, xulgaths'), + (1, 1, 1, '65', 'Common', 'Humans, dwarves, elves, halflings, and other common ancestries'), + (2, 1, 1, '65', 'Draconic', 'Dragons, reptilian humanoids'), + (3, 1, 1, '65', 'Dwarven', 'Dwarves'), + (4, 1, 1, '65', 'Elven', 'Elves, half-elves'), + (5, 1, 1, '65', 'Gnomish', 'Gnomes'), + (6, 1, 1, '65', 'Goblin', 'Goblins, hobgoblins, bugbears'), + (7, 1, 1, '65', 'Halfling', 'Halflings'), + (8, 1, 1, '65', 'Jotun', 'Giants, ogres, trolls, ettins, cyclopes'), + (9, 1, 1, '65', 'Orcish', 'Orcs, half-orcs'), + (10, 1,1, '65', 'Sylvan', 'Fey, centaurs, plant creatures'), + (11, 1,1, '65', 'Undercommon', 'Drow, duergars, xulgaths'), -- Uncommon languages - (100, 2, 'Abyssal', 'Demons'), - (101, 2, 'Aklo', 'Deros, evil fey, otherworldly monsters'), - (102, 2, 'Aquan', 'Aquatic creatures, water elemental creatures'), - (103, 2, 'Auran', 'Air elemental creatures, flying creatures'), - (104, 2, 'Celestial', 'Angels'), - (105, 2, 'Gnoll', 'Gnolls'), - (106, 2, 'Ignan', 'Fire elemental creatures'), - (107, 2, 'Infernal', 'Devils'), - (108, 2, 'Necril', 'Ghouls, intelligent undead'), - (109, 2, 'Shadowtongue', 'Nidalese, Shadow Plane creatures'), - (110, 2, 'Terran', 'Earth elemental creatures'), - -- Secret language s - (200, 3, 'Druidic', 'Druids'); + (100, 2, 1, '65', 'Abyssal', 'Demons'), + (101, 2, 1, '65', 'Aklo', 'Deros, evil fey, otherworldly monsters'), + (102, 2, 1, '65', 'Aquan', 'Aquatic creatures, water elemental creatures'), + (103, 2, 1, '65', 'Auran', 'Air elemental creatures, flying creatures'), + (104, 2, 1, '65', 'Celestial', 'Angels'), + (105, 2, 1, '65', 'Gnoll', 'Gnolls'), + (106, 2, 1, '65', 'Ignan', 'Fire elemental creatures'), + (107, 2, 1, '65', 'Infernal', 'Devils'), + (108, 2, 1, '65', 'Necril', 'Ghouls, intelligent undead'), + (109, 2, 1, '65', 'Shadowtongue', 'Nidalese, Shadow Plane creatures'), + (110, 2, 1, '65', 'Terran', 'Earth elemental creatures'), + -- Secret languages + (200, 3, 1, '65', 'Druidic', 'Druids'); diff --git a/data/sources.sql b/data/sources.sql index 3759e67..9ae6da3 100644 --- a/data/sources.sql +++ b/data/sources.sql @@ -12,6 +12,7 @@ INSERT INTO sources (sources_id, first_party, ogl_copyright_block) VALUES + -- Core Rulebook (1, 'Pathfinder Core Rulebook (Second Edition)', 'Core Rulebook', @@ -20,6 +21,7 @@ VALUES '2019-08-01', 1, 'Open Game License v.1.0a (c) 2000, Wizards of the Coast, Inc.; System Reference Document (c) 2000, Wizards of the Coast, Inc.; Authors: Jonathan Tweet, Monte Cook, and Skip Williams, based on material by E. Gary Gygax and Dave Arneson. Pathfinder Core Rulebook (Second Edition) (c) 2019, Paizo, Inc.; Designers: Logan Bonner, Jason Bulmahn, Stephen Radney-MacFarland, and Mark Seifter.'), + -- Bestiary 1 (2, 'Pathfinder Bestiary (Second Edition)', 'Bestiary', diff --git a/gendb.bat b/gendb.bat index 72ba0b2..107734c 100644 --- a/gendb.bat +++ b/gendb.bat @@ -2,9 +2,9 @@ del pf2.db :: Loading schema +sqlite3 pf2.db < schema/sources.sql sqlite3 pf2.db < schema/abilityscores.sql sqlite3 pf2.db < schema/sizes.sql -sqlite3 pf2.db < schema/sources.sql sqlite3 pf2.db < schema/langs.sql sqlite3 pf2.db < schema/traits.sql sqlite3 pf2.db < schema/feats.sql @@ -12,9 +12,11 @@ sqlite3 pf2.db < schema/senses.sql sqlite3 pf2.db < schema/ancestries.sql :: Loading data +sqlite3 pf2.db < data/sources.sql sqlite3 pf2.db < data/abilityscores.sql -sqlite3 pf2.db < data/visions.sql +sqlite3 pf2.db < data/senses.sql sqlite3 pf2.db < data/sizes.sql +sqlite3 pf2.db < data/langs.sql sqlite3 pf2.db < data/traits.sql sqlite3 pf2.db < data/ancestries.sql sqlite3 pf2.db < data/heritages.sql diff --git a/gendb.sh b/gendb.sh index 20508a8..7c92623 100755 --- a/gendb.sh +++ b/gendb.sh @@ -1,11 +1,11 @@ rm pf2.db echo 'loading schema' +echo 'schema/sources.sql' +sqlite3 pf2.db < schema/sources.sql echo 'schema/abilityscores.sql' sqlite3 pf2.db < schema/abilityscores.sql echo 'schema/sizes.sql' sqlite3 pf2.db < schema/sizes.sql -echo 'schema/sources.sql' -sqlite3 pf2.db < schema/sources.sql echo 'schema/langs.sql' sqlite3 pf2.db < schema/langs.sql echo 'schema/traits.sql' @@ -17,12 +17,16 @@ sqlite3 pf2.db < schema/senses.sql echo 'schema/ancestries.sql' sqlite3 pf2.db < schema/ancestries.sql echo 'loading data' +echo 'data/sources.sql' +sqlite3 pf2.db < data/sources.sql echo 'data/abilityscores.sql' sqlite3 pf2.db < data/abilityscores.sql echo 'data/visions.sql' sqlite3 pf2.db < data/visions.sql echo 'data/sizes.sql' sqlite3 pf2.db < data/sizes.sql +echo 'data/langs.sql' +sqlite3 pf2.db < data/langs.sql echo 'data/traits.sql' sqlite3 pf2.db < data/traits.sql echo 'data/ancestries.sql' diff --git a/schema/langs.sql b/schema/langs.sql index 768cbdf..387b1d8 100644 --- a/schema/langs.sql +++ b/schema/langs.sql @@ -10,8 +10,9 @@ CREATE TABLE langs ( lang TEXT NOT NULL UNIQUE, speakers TEXT NOT NULL UNIQUE, rarity_id INTEGER NOT NULL, - src_book INTEGER NOT NULL, - src_pages TEXT NOT NULL, - FOREIGN KEY (rarity_id) REFERENCES langsrarity(rarity_id) + sources_id INTEGER NOT NULL, + sources_pages TEXT NOT NULL, + FOREIGN KEY (rarity_id) REFERENCES langsrarity(rarity_id), + FOREIGN KEY (sources_id) REFERENCES sources(sources_id) ); diff --git a/schema/sources.sql b/schema/sources.sql index e4bb0fd..678e780 100644 --- a/schema/sources.sql +++ b/schema/sources.sql @@ -1,5 +1,7 @@ -- -*- mode:sql sql-product:sqlite -*- +-- MUST BE CALLED EARLY IN SCRIPT + CREATE TABLE sources ( sources_id INTEGER PRIMARY KEY, sources_full_name TEXT NOT NULL UNIQUE,