From 01094d4a162a61eff2bbfc3c442bf9a53f7073ee Mon Sep 17 00:00:00 2001 From: James R Miller Date: Sun, 18 Aug 2019 20:06:28 -0500 Subject: [PATCH] -mmove to new sources way in monsters --- schema/monsters.sql | 8 +++++--- schema/sources.sql | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/schema/monsters.sql b/schema/monsters.sql index b1c5e38..a4448e0 100644 --- a/schema/monsters.sql +++ b/schema/monsters.sql @@ -21,8 +21,9 @@ PRAGMA foreign_keys = ON; CREATE TABLE monsters ( monsters_id INTEGER PRIMARY KEY, is_comty_use BOOLEAN NOT NULL, -- false = no community use policy req - sources_id INTEGER, - sources_pages TEXT, + sources_id INTEGER, -- old style source entries + sources_pages TEXT, -- old style source entries + sourceentries_id INTEGER, -- new style source entries -- monstercategories_id INTEGER, -- Humanoid etc.. "name" TEXT NOT NULL UNIQUE, "level" INTEGER, @@ -50,7 +51,8 @@ CREATE TABLE monsters ( FOREIGN KEY (alignments_id) REFERENCES alignments(alignments_id), -- FOREIGN KEY (monstercategories_id) REFERENCES monstercategories(monstercategories_id), FOREIGN KEY (sizes_id) REFERENCES sizes(sizes_id), - FOREIGN KEY (sources_id) REFERENCES sources(sources_id) + FOREIGN KEY (sources_id) REFERENCES sources(sources_id), + FOREIGN KEY (sourceentries_id) REFERENCES sourceentries(sourceentries_id) ); CREATE TABLE monsterflavortexttypes ( diff --git a/schema/sources.sql b/schema/sources.sql index 41bcd57..b42aebe 100644 --- a/schema/sources.sql +++ b/schema/sources.sql @@ -29,7 +29,7 @@ CREATE TABLE monsters_sourceentries ( monsters_id INTEGER NOT NULL, sourceentries_id INTEGER NOT NULL, FOREIGN KEY (monsters_id) REFERENCES monsters(monsters_id), - FOREIGN KEY (sourceentries_id_id) REFERENCES sourceentries_id(sourceentries_id_id) + FOREIGN KEY (sourceentries_id) REFERENCES sourceentries(sourceentries_id) ); -- TODO add in new many-to-many tables for the various things we want to have sources be listed this way