change pragma to enforce foreign-keys

merge-requests/34/merge
James Miller 2019-08-14 23:00:46 -05:00
parent 5d1db999ac
commit 13754f2808
15 changed files with 44 additions and 0 deletions

View File

@ -1,5 +1,8 @@
-- -*- mode:sql sql-product:sqlite -*- -- -*- mode:sql sql-product:sqlite -*-
PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned
-- on PER CONNECTION
INSERT INTO abilityscores (abilityscores_id, flag_rep, short_name, long_name) INSERT INTO abilityscores (abilityscores_id, flag_rep, short_name, long_name)
VALUES VALUES
(1, 1, 'STR', 'Strength'), (1, 1, 'STR', 'Strength'),

View File

@ -1,5 +1,8 @@
-- -*- mode:sql sql-product:sqlite -*- -- -*- mode:sql sql-product:sqlite -*-
PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned
-- on PER CONNECTION
INSERT INTO actioncosts ( INSERT INTO actioncosts (
actioncosts_id, actioncosts_id,
name, name,

View File

@ -4,6 +4,9 @@
one-paragraph at the top of the section, and we put in all the extra details as one-paragraph at the top of the section, and we put in all the extra details as
a field with markdown formatted text. Need to think on it. */ a field with markdown formatted text. Need to think on it. */
PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned
-- on PER CONNECTION
INSERT INTO ancestries (ancestry_id, short_name, flavor_text, hp, size_id, speed, vision_id,sources_id,sources_pages) INSERT INTO ancestries (ancestry_id, short_name, flavor_text, hp, size_id, speed, vision_id,sources_id,sources_pages)
VALUES VALUES
(1, 'Dwarf', 'TODO', 10, 3, 20, 1,1,"35"), (1, 'Dwarf', 'TODO', 10, 3, 20, 1,1,"35"),

View File

@ -1,4 +1,6 @@
PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned
-- on PER CONNECTION
INSERT INTO armorgroup ( INSERT INTO armorgroup (
grp_id, grp_id,

View File

@ -1,5 +1,8 @@
-- -*- mode:sql sql-product:sqlite -*- -- -*- mode:sql sql-product:sqlite -*-
PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned
-- on PER CONNECTION
INSERT INTO backgrounds ( INSERT INTO backgrounds (
bg_id, bg_id,
sources_id, sources_id,

View File

@ -1,6 +1,9 @@
-- TODO update sizes table with a FK to bulk to get the data from the table on -- TODO update sizes table with a FK to bulk to get the data from the table on
-- pg 272 CRB -- pg 272 CRB
PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned
-- on PER CONNECTION
INSERT INTO bulk ( INSERT INTO bulk (
bulk_id, bulk_id,
sources_id, sources_id,

View File

@ -1,5 +1,8 @@
-- -*- mode:sql sql-product:sqlite -*- -- -*- mode:sql sql-product:sqlite -*-
PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned
-- on PER CONNECTION
-- TODO Fill in the remaining short descriptions from pag 454 CRB -- TODO Fill in the remaining short descriptions from pag 454 CRB
INSERT INTO conditions ( INSERT INTO conditions (

View File

@ -1,5 +1,8 @@
-- -*- mode:sql sql-product:sqlite -*- -- -*- mode:sql sql-product:sqlite -*-
PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned
-- on PER CONNECTION
INSERT INTO featprereqs (featprereqs_id, feat_id, descr) INSERT INTO featprereqs (featprereqs_id, feat_id, descr)
VALUES VALUES
(1, NULL, 'Ancestry Level 1'), (1, NULL, 'Ancestry Level 1'),

View File

@ -1,5 +1,8 @@
-- -*- mode:sql sql-product:sqlite -*- -- -*- mode:sql sql-product:sqlite -*-
PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned
-- on PER CONNECTION
/* TODO figure out how to model the reaction with heritages */ /* TODO figure out how to model the reaction with heritages */
/* TODO how to add in vision for Half-elf Heritage? */ /* TODO how to add in vision for Half-elf Heritage? */

View File

@ -1,5 +1,8 @@
-- -*- mode:sql sql-product:sqlite -*- -- -*- mode:sql sql-product:sqlite -*-
PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned
-- on PER CONNECTION
INSERT INTO langsrarity (rarity_id, rarity_name) INSERT INTO langsrarity (rarity_id, rarity_name)
VALUES VALUES
(1, 'Common'), (1, 'Common'),

View File

@ -1,5 +1,8 @@
-- -*- mode:sql sql-product:sqlite -*- -- -*- mode:sql sql-product:sqlite -*-
PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned
-- on PER CONNECTION
/* TODO add in any different vision types from Bestiary / Monsters */ /* TODO add in any different vision types from Bestiary / Monsters */
/* TODO smoke vision is from young-red dragon */ /* TODO smoke vision is from young-red dragon */

View File

@ -1,5 +1,8 @@
-- -*- mode:sql sql-product:sqlite -*- -- -*- mode:sql sql-product:sqlite -*-
PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned
-- on PER CONNECTION
INSERT INTO sizes (size_id, short_name, space_in_ft, reach_tall_ft, reach_long_ft) VALUES INSERT INTO sizes (size_id, short_name, space_in_ft, reach_tall_ft, reach_long_ft) VALUES
(1,'Tiny',4,0,0), (1,'Tiny',4,0,0),
(2,'Small',5,5,5), (2,'Small',5,5,5),

View File

@ -1,5 +1,8 @@
-- -*- mode:sql sql-product:sqlite -*- -- -*- mode:sql sql-product:sqlite -*-
PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned
-- on PER CONNECTION
/* TODO Decide on how to format the copyright block text... perhaps with Markdown? */ /* TODO Decide on how to format the copyright block text... perhaps with Markdown? */

View File

@ -1,4 +1,7 @@
PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned
-- on PER CONNECTION
INSERT INTO spelltypes ( INSERT INTO spelltypes (
spelltypes_id, spelltypes_id,
name name

View File

@ -7,6 +7,9 @@
-- --
-- ######################################################### -- #########################################################
PRAGMA foreign_keys = ON; -- database requires foreign key checking to be turned
-- on PER CONNECTION
INSERT INTO traittypes (traittype_id, name) INSERT INTO traittypes (traittype_id, name)
VALUES VALUES
(1, 'None'), (1, 'None'),