Started on member migration

This commit is contained in:
2025-01-31 13:36:09 +01:00
parent 169e89cefb
commit 9cf9e5752f
30 changed files with 1122 additions and 58 deletions

View File

@@ -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);

View 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
);