aboutsummaryrefslogtreecommitdiff
path: root/migrations/auth/20221110_01_WtZ1I-create-resources-table.py
diff options
context:
space:
mode:
Diffstat (limited to 'migrations/auth/20221110_01_WtZ1I-create-resources-table.py')
-rw-r--r--migrations/auth/20221110_01_WtZ1I-create-resources-table.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/migrations/auth/20221110_01_WtZ1I-create-resources-table.py b/migrations/auth/20221110_01_WtZ1I-create-resources-table.py
index 09ed891..0b769b8 100644
--- a/migrations/auth/20221110_01_WtZ1I-create-resources-table.py
+++ b/migrations/auth/20221110_01_WtZ1I-create-resources-table.py
@@ -15,8 +15,11 @@ steps = [
resource_name TEXT NOT NULL,
resource_category_id TEXT NOT NULL,
PRIMARY KEY(group_id, resource_id),
- FOREIGN KEY(group_id) REFERENCES groups(group_id),
- FOREIGN KEY(resource_category_id) REFERENCES resource_categories(resource_category_id)
+ FOREIGN KEY(group_id) REFERENCES groups(group_id)
+ ON UPDATE CASCADE ON DELETE RESTRICT,
+ FOREIGN KEY(resource_category_id)
+ REFERENCES resource_categories(resource_category_id)
+ ON UPDATE CASCADE ON DELETE RESTRICT
) WITHOUT ROWID
""",
"DROP TABLE IF EXISTS resources")