bitque/migrations/2020-04-20-172406_create_invitations/up.sql

17 lines
467 B
MySQL
Raw Normal View History

2023-03-31 23:25:20 +02:00
create type "InvitationState" AS ENUM (
2020-04-21 08:35:08 +02:00
'sent',
'accepted',
'revoked'
);
create table invitations (
id serial primary key not null,
name text not null,
email text not null,
2023-03-31 23:25:20 +02:00
state "InvitationState" not null default 'sent',
2020-04-21 08:35:08 +02:00
project_id integer not null references projects (id),
invited_by_id integer not null references users (id),
created_at timestamp not null default now(),
updated_at timestamp not null default now()
);