Remove membership derived struct fields

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-02-13 12:51:14 +04:00
parent baeb758a4f
commit 4c67217e35
3 changed files with 56 additions and 187 deletions

View File

@@ -1,31 +1,2 @@
ALTER TABLE
iam_memberships
ADD
COLUMN profile_id REFERENCES iam_membership_profiles(id);
UPDATE
iam_memberships m
SET
profile_id = p.id
FROM
iam_membership_profiles p
WHERE
p.membership_id = m.id;
DROP INDEX authz_memberships_user_id_organization_id_key;
DROP INDEX idx_iam_memberships_identity_tenant_org;
CREATE UNIQUE INDEX idx_iam_memberships_profile_id_idx ON iam_memberships(profile_id);
ALTER TABLE
iam_memberships
ALTER COLUMN
profile_id
SET
NOT NULL,
DROP COLUMN organization_id,
DROP COLUMN identity_id;
ALTER TABLE
iam_membership_profiles DROP COLUMN membership_id;