diff options
Diffstat (limited to 'migrations/auth/20221117_01_RDlfx-modify-group-roles-add-group-role-id.py')
-rw-r--r-- | migrations/auth/20221117_01_RDlfx-modify-group-roles-add-group-role-id.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/migrations/auth/20221117_01_RDlfx-modify-group-roles-add-group-role-id.py b/migrations/auth/20221117_01_RDlfx-modify-group-roles-add-group-role-id.py index 2deff10..a4d7806 100644 --- a/migrations/auth/20221117_01_RDlfx-modify-group-roles-add-group-role-id.py +++ b/migrations/auth/20221117_01_RDlfx-modify-group-roles-add-group-role-id.py @@ -23,8 +23,10 @@ steps = [ group_id TEXT NOT NULL, role_id TEXT NOT NULL, PRIMARY KEY(group_id, role_id), - FOREIGN KEY(group_id) REFERENCES groups(group_id), + FOREIGN KEY(group_id) REFERENCES groups(group_id) + ON UPDATE CASCADE ON DELETE RESTRICT, FOREIGN KEY(role_id) REFERENCES roles(role_id) + ON UPDATE CASCADE ON DELETE RESTRICT ) WITHOUT ROWID """), step( @@ -34,8 +36,10 @@ steps = [ group_id TEXT NOT NULL, role_id TEXT NOT NULL, UNIQUE (group_id, role_id), - FOREIGN KEY(group_id) REFERENCES groups(group_id), + FOREIGN KEY(group_id) REFERENCES groups(group_id) + ON UPDATE CASCADE ON DELETE RESTRICT, FOREIGN KEY(role_id) REFERENCES roles(role_id) + ON UPDATE CASCADE ON DELETE RESTRICT ) WITHOUT ROWID """, "DROP TABLE IF EXISTS group_roles"), |