Revert "Removed insert for id, removed composite PK created id INTEGER PRIMARY KEY"

This reverts commit 3ab787ec11.
This commit is contained in:
Brian Haley committed 2019-09-03 12:23:31 -04:00
1 parent 3ab787ec11
commit 068c2fb2b8
2 files changed
+52 -55

No files matched your search

+3 -6
View File
@@ -28,31 +28,28 @@ CREATE TABLE staffactivations (
-- Joining table --
CREATE TABLE staff_staffactivations (
id INTEGER PRIMARY KEY,
staff_id INTEGER,
staffactivations_id INTEGER,
PRIMARY KEY (staff_id, staffactivations_id),
FOREIGN KEY (staff_id) REFERENCES staff(staff_id),
FOREIGN KEY (staffactivations_id) REFERENCES staffactivations(staffactivations_id)
);
-- Joining table --
CREATE TABLE staff_trait (
id INTEGER PRIMARY KEY,
staff_id INTEGER,
trait_id INTEGER,
PRIMARY KEY (staff_id, trait_id),
FOREIGN KEY (staff_id) REFERENCES staff(staff_id),
FOREIGN KEY (trait_id) REFERENCES traits(trait_id)
);
-- Joining table --
CREATE TABLE staff_spell (
id INTEGER PRIMARY KEY,
staff_id INTEGER,
"level" INTEGER NOT NULL, -- This represents the level of the spell in the staff where 0 = cantrip --
spell_id INTEGER,
PRIMARY KEY (staff_id, "level", spell_id),
FOREIGN KEY (staff_id) REFERENCES staff(staff_id),
FOREIGN KEY (spell_id) REFERENCES spells(spells_id)
);
-- TODO CREATE TABLE staff_sourceentries -- joining table --
);