up.sql 374 Bytes
Newer Older
Gaël Berthaud-Müller's avatar
Gaël Berthaud-Müller committed
1
2
3
-- Your SQL goes here
CREATE TABLE localuser (
  user_id VARCHAR NOT NULL PRIMARY KEY,
4
  username VARCHAR NOT NULL UNIQUE,
Gaël Berthaud-Müller's avatar
Gaël Berthaud-Müller committed
5
6
7
8
9
10
  password VARCHAR NOT NULL,
  FOREIGN KEY(user_id) REFERENCES user(id)
);

CREATE TABLE user (
  id VARCHAR NOT NULL PRIMARY KEY,
11
  role TEXT CHECK(role IN ('admin', 'zoneadmin')) NOT NULL -- note: migrate to postgres so enum are actually a thing
Gaël Berthaud-Müller's avatar
Gaël Berthaud-Müller committed
12
);