Updated schemas
This commit is contained in:
@@ -1,10 +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,
|
||||
CREATE TABLE "members" (
|
||||
member_id varchar(7) NOT NULL PRIMARY KEY,
|
||||
first_name text NOT NULL,
|
||||
full_name text NOT NULL,
|
||||
registration_token text NOT NULL UNIQUE,
|
||||
diploma text,
|
||||
hours text[] not null,
|
||||
groups text[] not null
|
||||
hours text[] NOT NULL,
|
||||
groups text[] NOT NULL
|
||||
);
|
||||
|
||||
|
13
server/migrations/002_create_users.sql
Normal file
13
server/migrations/002_create_users.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
CREATE TABLE "users" (
|
||||
user_id uuid NOT NULL PRIMARY KEY,
|
||||
email text UNIQUE,
|
||||
password text NOT NULL,
|
||||
admin boolean NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS users_members (
|
||||
user_id uuid NOT NULL REFERENCES users (user_id) ON UPDATE cascade ON DELETE cascade,
|
||||
member_id varchar(7) NOT NULL REFERENCES members (member_id) ON UPDATE cascade ON DELETE cascade,
|
||||
|
||||
CONSTRAINT users_members_pkey PRIMARY KEY (user_id, member_id)
|
||||
);
|
Reference in New Issue
Block a user