2019-08-06 20:15:44 -04:00
|
|
|
-- -*- mode:sql sql-product:sqlite -*-
|
|
|
|
|
|
|
|
CREATE TABLE backgrounds (
|
|
|
|
bg_id INTEGER PRIMARY KEY,
|
2019-08-18 13:41:12 -04:00
|
|
|
"name" TEXT NOT NULL UNIQUE,
|
|
|
|
descr TEXT NOT NULL,
|
|
|
|
is_comty_use BOOLEAN NOT NULL, -- false = no community use policy required
|
|
|
|
is_specific_to_adv BOOLEAN NOT NULL, -- means the background is specific to its adventure
|
2019-08-06 20:15:44 -04:00
|
|
|
FOREIGN KEY (sources_id) REFERENCES sources(sources_id)
|
|
|
|
);
|
2019-09-06 17:19:43 -04:00
|
|
|
|
|
|
|
-- Joining table --
|
|
|
|
CREATE TABLE backgrounds_sourceentries (
|
|
|
|
id INTEGER PRIMARY KEY
|
|
|
|
,bg_id INTEGER NOT NULL
|
|
|
|
,sourceentry_id INTEGER NOT NULL
|
2019-09-06 17:57:45 -04:00
|
|
|
,UNIQUE (id, bg_id, sourceentry_id),
|
2019-09-06 17:19:43 -04:00
|
|
|
,FOREIGN KEY (bg_id) REFERENCES backgrounds(bg_id)
|
|
|
|
,FOREIGN KEY (sourceentry_id) REFERENCES sourceentries(sourceentry_id)
|
|
|
|
);
|