mirror of
https://github.com/penpot/penpot.git
synced 2026-05-06 00:28:43 +00:00
14 lines
375 B
SQL
14 lines
375 B
SQL
ALTER TABLE team_invitation
|
|
ADD COLUMN org_id uuid NULL;
|
|
|
|
ALTER TABLE team_invitation
|
|
ALTER COLUMN team_id DROP NOT NULL;
|
|
|
|
ALTER TABLE team_invitation
|
|
ADD CONSTRAINT team_invitation_team_or_org_not_null
|
|
CHECK (team_id IS NOT NULL OR org_id IS NOT NULL);
|
|
|
|
CREATE UNIQUE INDEX team_invitation_org_unique
|
|
ON team_invitation (org_id, email_to)
|
|
WHERE team_id IS NULL;
|