updated migrations

This commit is contained in:
Mitchell Marino 2023-04-11 22:53:07 -05:00
parent 4a183b6820
commit a96867d1b9
2 changed files with 11 additions and 8 deletions

View File

@ -1,6 +1,8 @@
CREATE TYPE role AS ENUM ('student', 'teacher', 'admin');
CREATE TABLE users ( CREATE TABLE users (
id SERIAL PRIMARY KEY, id SERIAL PRIMARY KEY,
role role NOT NULL,
username varchar(255) UNIQUE NOT NULL, username varchar(255) UNIQUE NOT NULL,
password bytea password bytea NOT NULL
); );

View File

@ -2,13 +2,14 @@ CREATE TYPE event_type AS ENUM ('sports', 'meetings', 'drama', 'music', 'other')
CREATE TABLE events ( CREATE TABLE events (
id SERIAL PRIMARY KEY, id SERIAL PRIMARY KEY,
title VARCHAR(255), description TEXT NOT NULL,
time_start TIMESTAMP, title VARCHAR(255) NOT NULL,
time_end TIMESTAMP, time_start TIMESTAMP NOT NULL,
event_type event_type, time_end TIMESTAMP NOT NULL,
points INTEGER, event_type event_type NOT NULL,
points INTEGER NOT NULL,
place VARCHAR(255), place VARCHAR(255),
price DECIMAL(10, 2), price DECIMAL(10, 2) NOT NULL,
created_by INTEGER REFERENCES users(id) created_by INTEGER REFERENCES users(id)
); );