mirror of
https://gitlab.com/jrmiller82/pathfinder-2-sqlite.git
synced 2026-11-10 21:29:44 -05:00
damageTypes sourceEntry conversion
This commit is contained in:
1 parent
4501f6a0f3
commit
c327528523
2 files changed
+88
-14
No files matched your search
+20
-6
@@ -10,20 +10,34 @@
|
||||
|
||||
CREATE TABLE damagecategories (
|
||||
damagecategories_id INTEGER PRIMARY KEY,
|
||||
sources_id INTEGER,
|
||||
sources_pages TEXT,
|
||||
"name" TEXT NOT NULL UNIQUE,
|
||||
descr TEXT,
|
||||
FOREIGN KEY (sources_id) REFERENCES sources(sources_id)
|
||||
);
|
||||
|
||||
CREATE TABLE damagetypes (
|
||||
damagetypes_id INTEGER PRIMARY KEY,
|
||||
sources_id INTEGER,
|
||||
sources_pages TEXT,
|
||||
damagecategories_id INTEGER NOT NULL,
|
||||
"abbr" TEXT,
|
||||
"name" TEXT NOT NULL UNIQUE,
|
||||
FOREIGN KEY (damagecategories_id) REFERENCES damagecategories(damagecategories_id),
|
||||
FOREIGN KEY (sources_id) REFERENCES sources(sources_id)
|
||||
);
|
||||
|
||||
-- Joining table --
|
||||
CREATE TABLE damagecategories_sourceentries (
|
||||
id INTEGER PRIMARY KEY
|
||||
,damagecategories_id INTEGER NOT NULL
|
||||
,sourceentry_id INTEGER NOT NULL
|
||||
,UNIQUE (id, damagecategories_id, sourceentry_id)
|
||||
,FOREIGN KEY (damagecategories_id) REFERENCES damagecategories(damagecategories_id)
|
||||
,FOREIGN KEY (sourceentry_id) REFERENCES sourceentries(sourceentry_id)
|
||||
);
|
||||
|
||||
-- Joining table --
|
||||
CREATE TABLE damagetypes_sourceentries (
|
||||
id INTEGER PRIMARY KEY
|
||||
,damagetypes_id INTEGER NOT NULL
|
||||
,sourceentry_id INTEGER NOT NULL
|
||||
,UNIQUE (id, damagetypes_id, sourceentry_id)
|
||||
,FOREIGN KEY (damagetypes_id) REFERENCES damagetypes(damagetypes_id)
|
||||
,FOREIGN KEY (sourceentry_id) REFERENCES sourceentries(sourceentry_id)
|
||||
);
|
||||
Reference in new issue
Block a user