pathfinder-2-sqlite-MIRROR/schema/conditions.sql

19 lines
584 B
MySQL
Raw Normal View History

2019-08-08 14:00:45 -04:00
-- -*- mode:sql sql-product:sqlite -*-
CREATE TABLE conditions (
conditions_id INTEGER PRIMARY KEY,
name TEXT UNIQUE NOT NULL,
short_descr TEXT NOT NULL,
descr TEXT NOT NULL,
FOREIGN KEY (sources_id) REFERENCES sources(sources_id)
);
2019-09-06 20:25:04 -04:00
-- Joining table --
CREATE TABLE conditions_sourceentries (
id INTEGER PRIMARY KEY
,conditions_id INTEGER NOT NULL
,sourceentry_id INTEGER NOT NULL
,UNIQUE (id, conditions_id, sourceentry_id)
,FOREIGN KEY (conditions_id) REFERENCES conditions(conditions_id)
,FOREIGN KEY (sourceentry_id) REFERENCES sourceentries(sourceentry_id)
);