Advertisement
Guest User

Untitled

a guest
Sep 11th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. create table invites(
  2.     id uuid primary key not null,
  3.  
  4.     email text not null,
  5.     "role" organization_role not null,
  6.     organization_id bigint not null references organizations(id),
  7.  
  8.     invited_by bigint not null references customers(id),
  9.  
  10.     created_at timestamp not null
  11. );
  12.  
  13. create index ON invites(organization_id);
  14. create index ON invites(invited_by);
  15. create index ON invites(email);
  16.  
  17. create unique index ON invites(email, organization_id);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement