mirror of
https://gitlab.com/jrmiller82/pathfinder-2-sqlite.git
synced 2026-10-16 22:29:44 -04:00
Armour sourceentry conversion
This commit is contained in:
1 parent
f47aa5d0d3
commit
964133aed0
2 files changed
+79
-25
No files matched your search
+18
-4
@@ -1,8 +1,6 @@
|
||||
|
||||
CREATE TABLE armorgroup (
|
||||
grp_id INTEGER PRIMARY KEY,
|
||||
sources_id INTEGER NOT NULL,
|
||||
sources_pages TEXT NOT NULL,
|
||||
short_name TEXT NOT NULL UNIQUE,
|
||||
descr TEXT NOT NULL,
|
||||
FOREIGN KEY (sources_id) REFERENCES sources(sources_id)
|
||||
@@ -15,8 +13,6 @@ CREATE TABLE armorcategory (
|
||||
|
||||
CREATE TABLE armor (
|
||||
armor_id INTEGER PRIMARY KEY,
|
||||
sources_id INTEGER NOT NULL,
|
||||
sources_pages TEXT,
|
||||
armor_category_id INTEGER NOT NULL,
|
||||
short_name TEXT NOT NULL,
|
||||
item_level INTEGER,
|
||||
@@ -43,4 +39,22 @@ CREATE TABLE armor_traits (
|
||||
FOREIGN KEY (trait_id) REFERENCES traits(trait_id)
|
||||
);
|
||||
|
||||
-- Joining table --
|
||||
CREATE TABLE armorgroup_sorceentries (
|
||||
id INTEGER PRIMARY KEY
|
||||
,grp_id INTEGER NOT NULL
|
||||
,sourceentry_id INTEGER NOT NULL
|
||||
,UNIQUE (id, grp_id, soruceentry_id),
|
||||
,FOREIGN KEY (grp_id) REFERENCES armorgroup(grp_id)
|
||||
,FOREIGN KEY (sourceentry_id) REFERENCES sourceentries(sourceentry_id)
|
||||
);
|
||||
|
||||
-- Joining table --
|
||||
CREATE TABLE armor_sourceentries (
|
||||
id INTEGER PRIMARY KEY
|
||||
,armor_id INTEGER NOT NULL
|
||||
,sourceentry_id INTEGER NOT NULL
|
||||
,UNIQUE (id, armor_id, soruceentry_id),
|
||||
,FOREIGN KEY (armor_id) REFERENCES armor(armor_id)
|
||||
,FOREIGN KEY (sourceentry_id) REFERENCES sourceentries(sourceentry_id)
|
||||
);
|
||||
Reference in new issue
Block a user