Started on member migration
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
CREATE TABLE user (
|
||||
id bigint NOT NULL PRIMARY KEY,
|
||||
email text NOT NULL UNIQUE,
|
||||
password text NOT NULL,
|
||||
admin boolean NOT NULL
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE member (
|
||||
id varchar(7) NOT NULL PRIMARY KEY,
|
||||
call_sign text NOT NULL,
|
||||
name text NOT NULL,
|
||||
registration_token text NOT NULL UNIQUE,
|
||||
diploma text,
|
||||
hours text[] NOT NULL,
|
||||
groups text[] NOT NULL
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE session (
|
||||
id bigint NOT NULL PRIMARY KEY,
|
||||
user_id bigint NOT NULL,
|
||||
token text NOT NULL UNIQUE,
|
||||
expires timestamp NOT NULL
|
||||
);
|
||||
|
||||
|
||||
ALTER TABLE session ADD CONSTRAINT session_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id);
|
10
server/migrations/001_create_members.sql
Normal file
10
server/migrations/001_create_members.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
create table "members" (
|
||||
id varchar(7) primary key,
|
||||
first_name text not null,
|
||||
full_name text not null,
|
||||
registration_token text unique not null,
|
||||
diploma text,
|
||||
hours text[] not null,
|
||||
groups text[] not null
|
||||
);
|
||||
|
Reference in New Issue
Block a user