· 8 years ago · Apr 23, 2018, 04:10 PM
1# Users schema
2
3# --- !Ups
4
5create table organisation (
6 id varchar(255) not null primary key,
7 email varchar(255) not null,
8 name varchar(255) not null,
9 password varchar(255) not null
10);
11
12create table user (
13 id varchar(255) not null primary key,
14 org_id varchar(255) not null,
15 email varchar(255) not null,
16 name varchar(255) not null,
17 password varchar(255) not null,
18 constraint fk_organisation foreign key(org_id) references organisation(id) on delete set null
19);
20
21
22# --- !Downs
23
24drop table if exists users;
25drop table if exists organisations;