Signed-off-by: manish-singh-bisht <mthefool218@gmail.com> Signed-off-by: Bryan Frimin <bryan@getprobo.com>
11 lines
510 B
SQL
11 lines
510 B
SQL
DELETE FROM authz_invitations
|
|
WHERE organization_id NOT IN (SELECT id FROM organizations);
|
|
|
|
DELETE FROM authz_memberships
|
|
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;
|
|
|
|
ALTER TABLE authz_memberships ADD CONSTRAINT authz_memberships_organization_id_fkey
|
|
FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE; |