diff --git a/data/ancestries.sql b/data/ancestries.sql index 0c00251..17821d5 100644 --- a/data/ancestries.sql +++ b/data/ancestries.sql @@ -7,14 +7,14 @@ a field with markdown formatted text. Need to think on it. */ PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned -- on PER CONNECTION -INSERT INTO ancestries (ancestry_id, short_name, flavor_text, hp, size_id, speed, vision_id,sources_id,sources_pages) +INSERT INTO ancestries (ancestry_id, short_name, flavor_text, hp, size_id, speed, vision_id) VALUES - (1, 'Dwarf', 'TODO', 10, 3, 20, 1,1,'35'), - (2, 'Elf', 'TODO', 6, 3, 30, 2,1,'39'), - (3, 'Gnome', 'TODO', 8, 2, 25, 2,1,'43'), - (4, 'Goblin', 'TODO', 6, 2, 25, 1,1,'47'), - (5, 'Halfling', 'TODO', 6, 2, 25, 3,1,'51'), - (6, 'Human', 'TODO', 8, 3, 25, 4,1,'55'), + (1, 'Dwarf', 'TODO', 10, 3, 20, 1), + (2, 'Elf', 'TODO', 6, 3, 30, 2), + (3, 'Gnome', 'TODO', 8, 2, 25, 2), + (4, 'Goblin', 'TODO', 6, 2, 25, 1), + (5, 'Halfling', 'TODO', 6, 2, 25, 3), + (6, 'Human', 'TODO', 8, 3, 25, 4), (7, 'Half-Elf', 'TODO', 8, 3, 25, 4,1,'55'), (8, 'Half-Orc', 'TODO', 8, 3, 25, 4,1,'55'); @@ -81,3 +81,35 @@ VALUES (8,86), (8,182), (8,84); + +INSERT INTO sourceentries ( + sourceentry_id + ,sources_id + ,page_start + ,page_stop +) +VALUES + -- 300 to 399 is reserved for CRB ancestries -- + (300, 1, 35, 35) -- Dwarf -- + ,(301, 1, 39, 39) -- Elf -- + ,(302, 1, 43, 43) -- Gnome -- + ,(303, 1, 47, 47) -- Goblin -- + ,(304, 1, 51, 51) -- Halfling -- + ,(305, 1, 55, 55) -- Human, Half-elf, Half-orc -- +; + +INSERT INTO ancestries_sourceentries ( + id, + ,ancestry_id + ,sourceentry_id +) +VALUES + (1, 1, 300) -- Dwarf -- + ,(2, 2, 301) -- Elf -- + ,(3, 3, 302) -- Gnome -- + ,(4, 4, 303) -- Goblin -- + ,(5, 5, 304) -- Halfling -- + ,(6, 6, 305) -- Human -- + ,(7, 7, 305) -- Half-elf -- + ,(8, 8, 305) -- Half-orc -- +; \ No newline at end of file diff --git a/schema/ancestries.sql b/schema/ancestries.sql index 93ec7ed..7f9f768 100644 --- a/schema/ancestries.sql +++ b/schema/ancestries.sql @@ -10,8 +10,6 @@ table that matches feats to ancestries, etc.. CREATE TABLE ancestries ( ancestry_id INTEGER PRIMARY KEY, - sources_id INTEGER NOT NULL, - sources_pages TEXT, short_name TEXT NOT NULL UNIQUE, flavor_text TEXT NOT NULL, hp INTEGER NOT NULL, @@ -85,3 +83,12 @@ CREATE TABLE ancestry_additionalangs ( FOREIGN KEY (ancestry_id) REFERENCES ancestries(ancestry_id), FOREIGN KEY (lang_id) REFERENCES langs(lang_id) ); + +CREATE TABLE ancestries_sourceentries ( + id INTEGER PRIMARY KEY + ,ancestry_id INTEGER NOT NULL + ,sourceentry_id INTEGER NOT NULL + ,UNIQUE (id, actions_id, soruceentry_id), + ,FOREIGN KEY (ancestry_id) REFERENCES ancestries(ancestry_id) + ,FOREIGN KEY (sourceentry_id) REFERENCES sourceentries(sourceentry_id) +); \ No newline at end of file