mirror of
https://gitlab.com/jrmiller82/pathfinder-2-sqlite.git
synced 2026-10-16 22:29:44 -04:00
Ammunition sourceEntry conversion
This commit is contained in:
1 parent
f14b792ba2
commit
d7e768641c
2 files changed
+40
-8
No files matched your search
+11
-4
@@ -5,12 +5,19 @@ PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned
|
||||
|
||||
CREATE TABLE ammunition (
|
||||
ammunition_id INTEGER PRIMARY KEY,
|
||||
sources_id INTEGER,
|
||||
sources_pages TEXT,
|
||||
"name" TEXT NOT NULL UNIQUE,
|
||||
price_gp REAL,
|
||||
amount INTEGER,
|
||||
bulk REAL,
|
||||
descr TEXT,
|
||||
FOREIGN KEY (sources_id) REFERENCES sources(sources_id)
|
||||
)
|
||||
);
|
||||
|
||||
-- Joining table --
|
||||
CREATE TABLE ammunition_sourceentries (
|
||||
id INTEGER PRIMARY KEY
|
||||
,ammunition_id INTEGER NOT NULL
|
||||
,sourceentry_id INTEGER NOT NULL
|
||||
,UNIQUE (id, ammunition_id, sourceentry_id),
|
||||
,FOREIGN KEY (ammunition_id) REFERENCES ammunition(ammunition_id)
|
||||
,FOREIGN KEY (sourceentry_id) REFERENCES sourceentry(sourceentry_id)
|
||||
);
|
||||
Reference in new issue
Block a user