migrate db for events
This commit is contained in:
parent
c786b36cd3
commit
579fdb4dd0
21
migrations/20230405224136_events.sql
Normal file
21
migrations/20230405224136_events.sql
Normal file
@ -0,0 +1,21 @@
|
||||
CREATE TYPE event_type AS ENUM ('sports', 'meetings', 'drama', 'music', 'other');
|
||||
|
||||
CREATE TABLE events (
|
||||
id SERIAL PRIMARY KEY,
|
||||
title VARCHAR(255),
|
||||
time_start TIMESTAMP,
|
||||
time_end TIMESTAMP,
|
||||
event_type event_type,
|
||||
points INTEGER,
|
||||
place VARCHAR(255),
|
||||
price DECIMAL(10, 2),
|
||||
created_by INTEGER REFERENCES users(id)
|
||||
);
|
||||
|
||||
CREATE TABLE event_attendees (
|
||||
event_id INTEGER REFERENCES events(id),
|
||||
user_id INTEGER REFERENCES users(id),
|
||||
PRIMARY KEY (event_id, user_id)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_event_attendees ON event_attendees(event_id);
|
||||
Loading…
Reference in New Issue
Block a user