Added basic axum server
This commit is contained in:
28
server/migrations/001-create-user-member-session.sql
Normal file
28
server/migrations/001-create-user-member-session.sql
Normal file
@@ -0,0 +1,28 @@
|
||||
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);
|
Reference in New Issue
Block a user