From 84de5fabd0eea28a08de4f16898735b4b0b0c035 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Thu, 29 Aug 2019 17:34:39 -0400 Subject: [PATCH] Missing traits --- data/staves.sql | 131 ++++++++++++++++++++++++++++++++++++++++++++++ schema/staves.sql | 11 +++- 2 files changed, 141 insertions(+), 1 deletion(-) diff --git a/data/staves.sql b/data/staves.sql index 5249dc3..0ae0e2b 100644 --- a/data/staves.sql +++ b/data/staves.sql @@ -129,6 +129,137 @@ VALUES ,(36, "Interact", "This releases a 30-foot-burst magical explosion centered on the staff. This deals 2d8 force damage per charge remaining in the staff (DC 40 basic Reflex save). You automatically critically fail your save. A creature reduced to 0 Hit Points by this damage dies instantly; this is a death effect.") ,(36, "Cast a Spell", "You expend a number of charges from the staff to cast a spell from its list.") +------------------------ +-- staff_trait insert -- +------------------------ +INSERT INTO staff_trait ( + staff_id, + trait_id +) +VALUES +-- Animal Staff -- + (1, 207) +,(1, 41) +,(1, 142) +,(2, 207) +,(2, 41) +,(2, 142) +,(3, 207) +,(3, 41) +,(3, 142) +-- Mentalist's Staff -- +,(4, 207) +,(4, 41) +,(4, 142) +,(5, 207) +,(5, 41) +,(5, 142) +,(6, 207) +,(6, 41) +,(6, 142) +-- Staff of Abjuration -- +,(7, 205) +,(7, 41) +,(7, 142) +,(8, 205) +,(8, 41) +,(8, 142) +,(9, 205) +,(9, 41) +,(9, 142) +-- Staff of Conjuration -- +,(10, 206) +,(10, 41) +,(10, 142) +,(11, 206) +,(11, 41) +,(11, 142) +,(12, 206) +,(12, 41) +,(12, 142) +-- Staff of Divination -- +,(13, 205) +,(13, 41) +,(13, 142) +,(14, 205) +,(14, 41) +,(14, 142) +,(15, 205) +,(15, 41) +,(15, 142) +-- Staff of Enchantment -- +,(16, 208) +,(16, 41) +,(16, 142) +,(17, 208) +,(17, 41) +,(17, 142) +,(18, 208) +,(18, 41) +,(18, 142) +-- Staff of Evocation -- +,(19, 209) +,(19, 41) +,(19, 142) +,(20, 209) +,(20, 41) +,(20, 142) +,(21, 209) +,(21, 41) +,(21, 142) +-- Staff of Fire -- +,(22, 209) +,(22, 41) +,(22, 142) +,(23, 209) +,(23, 41) +,(23, 142) +,(24, 209) +,(24, 41) +,(24, 142) +-- Staff of Healing -- +,(25, 211) +,(25, 41) +,(25, 142) +,(26, 211) +,(26, 41) +,(26, 142) +,(27, 211) +,(27, 41) +,(27, 142) +,(28, 211) +,(28, 41) +,(28, 142) +-- Staff of Illumination -- +,(29, 209) +,(29, 41) +,(29, 142) +-- Staff of Illusion -- +,(30, 210) +,(30, 41) +,(30, 142) +,(31, 210) +,(31, 41) +,(31, 142) +,(32, 210) +,(32, 41) +,(32, 142) +-- Staff of Necromancy -- +,(33, 211) +,(33, 41) +,(33, 142) +,(34, 211) +,(34, 41) +,(34, 142) +,(35, 211) +,(35, 41) +,(35, 142) +-- Staff of Power -- +,(36, 209) +,(36, 41) +,(36, 142) +,(36, 202) + ------------------------ -- staff_spell insert -- ------------------------ diff --git a/schema/staves.sql b/schema/staves.sql index 7f3a460..dea06c6 100644 --- a/schema/staves.sql +++ b/schema/staves.sql @@ -30,11 +30,20 @@ CREATE TABLE staff_spell ( FOREIGN KEY spell_id REFERENCES spells(spells_id) ); --- Child table -- one-to-many +-- Child table -- one-to-many -- CREATE TABLE staff_activations ( staff_id INTEGER NOT NULL, "activation" TEXT NOT NULL, effect TEXT NOT NULL, PRIMARY KEY (staff_id, "activation", effect), FOREIGN KEY staff_id REFERENCES staff(staff_id) +); + +-- Child table -- many-to-many -- staff-to-traits -- +CREATE TABLE staff_trait ( + staff_id INTEGER NOT NULL, + trait_id INTEGER NOT NULL, + PRIMARY KEY (staff_id, trait_id), + FOREIGN KEY staff_id REFERENCES staff(staff_id), + FOREIGN KEY (trait_id) REFERENCES traits(trait_id) ); \ No newline at end of file