fix: cascade invitation on organization delete

Signed-off-by: manish-singh-bisht <mthefool218@gmail.com>
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
manish-singh-bisht
2025-12-05 21:44:05 +05:30
committed by Bryan Frimin
parent abbf33c063
commit 0d741c3c85

View File

@@ -0,0 +1,5 @@
DELETE FROM authz_invitations
WHERE organization_id NOT IN (SELECT id FROM organizations);
ALTER TABLE authz_invitations ADD CONSTRAINT authz_invitations_organization_id_fkey
FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE;