🎉 Add team invitations API

This commit is contained in:
Pablo Alba 2022-02-15 14:18:45 +01:00 committed by Andrey Antukh
parent 09a4cb30ec
commit 1990232adc
6 changed files with 155 additions and 10 deletions

View file

@ -0,0 +1,15 @@
CREATE TABLE team_invitation (
team_id uuid NOT NULL REFERENCES team(id) ON DELETE CASCADE,
email_to text NOT NULL,
role text NOT NULL,
valid_until timestamptz NOT NULL,
created_at timestamptz NOT NULL DEFAULT now(),
updated_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY(team_id, email_to)
);
ALTER TABLE team_invitation
ALTER COLUMN email_to SET STORAGE external,
ALTER COLUMN role SET STORAGE external;