-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(policy): Cascade delete policy when scope is deleted #5014
Conversation
This comment has been minimized.
This comment has been minimized.
6de70b3
to
7c483e3
Compare
Database schema diff between To understand how these diffs are generated and some limitations see the FunctionsUnchanged TablesUnchanged ViewsUnchanged TriggersUnchanged IndexesUnchanged ConstraintsUnchanged Foreign Key Constraintsdiff --git a/.schema-diff/fk_constraints_903039e88567379513ba420bb44d6b90fc047f15/policy_scope_id_fkey.sql b/.schema-diff/fk_constraints_25176fe370e000d8bd38a8c860b13862c28d8851/policy_scope_id_fkey.sql
index f2629ab4c..551cdf964 100644
--- a/.schema-diff/fk_constraints_903039e88567379513ba420bb44d6b90fc047f15/policy_scope_id_fkey.sql
+++ b/.schema-diff/fk_constraints_25176fe370e000d8bd38a8c860b13862c28d8851/policy_scope_id_fkey.sql
@@ -1,6 +1,6 @@
-- name: policy policy_scope_id_fkey; type: fk constraint; schema: public; owner: -
- add constraint policy_scope_id_fkey foreign key (scope_id) references public.iam_scope(public_id) on update cascade on delete restrict;
+ add constraint policy_scope_id_fkey foreign key (scope_id) references public.iam_scope(public_id) on update cascade on delete cascade;
-- name: policy_storage_policy policy_storage_policy_scope_id_fkey; type: fk constraint; schema: public; owner: -
- add constraint policy_storage_policy_scope_id_fkey foreign key (scope_id) references public.iam_scope(public_id) on update cascade on delete restrict;
+ add constraint policy_storage_policy_scope_id_fkey foreign key (scope_id) references public.iam_scope(public_id) on update cascade on delete cascade;
-- name: scope_policy_storage_policy scope_policy_storage_policy_scope_id_fkey; type: fk constraint; schema: public; owner: -
add constraint scope_policy_storage_policy_scope_id_fkey foreign key (scope_id) references public.iam_scope(public_id) on update cascade on delete cascade;
diff --git a/.schema-diff/fk_constraints_903039e88567379513ba420bb44d6b90fc047f15/policy_storage_policy_scope_id_fkey.sql b/.schema-diff/fk_constraints_25176fe370e000d8bd38a8c860b13862c28d8851/policy_storage_policy_scope_id_fkey.sql
index 4e2a7cdf8..29b51cfb5 100644
--- a/.schema-diff/fk_constraints_903039e88567379513ba420bb44d6b90fc047f15/policy_storage_policy_scope_id_fkey.sql
+++ b/.schema-diff/fk_constraints_25176fe370e000d8bd38a8c860b13862c28d8851/policy_storage_policy_scope_id_fkey.sql
@@ -1,4 +1,4 @@
-- name: policy_storage_policy policy_storage_policy_scope_id_fkey; type: fk constraint; schema: public; owner: -
- add constraint policy_storage_policy_scope_id_fkey foreign key (scope_id) references public.iam_scope(public_id) on update cascade on delete restrict;
+ add constraint policy_storage_policy_scope_id_fkey foreign key (scope_id) references public.iam_scope(public_id) on update cascade on delete cascade;
-- name: scope_policy_storage_policy scope_policy_storage_policy_scope_id_fkey; type: fk constraint; schema: public; owner: -
add constraint scope_policy_storage_policy_scope_id_fkey foreign key (scope_id) references public.iam_scope(public_id) on update cascade on delete cascade; |
@hugoghx PTAL, this came up as a potential bug since a user could not delete a org without first deleting all policies. Since we cannot delete the global scope this will only impact orgs and since the policy can only be used by the org and is not directly associated with any session recordings I believe this change is sound. Please let me know if you can think of any reason to restrict delete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM I can't think of any issues with this change.
No description provided.