Update database structure
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -0,0 +1,2 @@
|
||||
DROP TABLE IF EXISTS accomodations_reservations;
|
||||
DROP TABLE IF EXISTS accomodations_list;
|
@ -0,0 +1,24 @@
|
||||
-- Create tables
|
||||
CREATE TABLE IF NOT EXISTS accommodations_list
|
||||
(
|
||||
id SERIAL PRIMARY KEY,
|
||||
family_id integer NOT NULL REFERENCES families,
|
||||
time_create BIGINT NOT NULL,
|
||||
time_update BIGINT NOT NULL,
|
||||
need_validation BOOLEAN,
|
||||
description text NULL,
|
||||
open_to_reservation BOOLEAN
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS accommodations_reservations
|
||||
(
|
||||
id SERIAL PRIMARY KEY,
|
||||
family_id integer NOT NULL REFERENCES families ON DELETE CASCADE,
|
||||
accommodation_id integer NOT NULL REFERENCES accommodations_list ON DELETE CASCADE,
|
||||
user_id INTEGER NOT NULL REFERENCES users ON DELETE CASCADE,
|
||||
time_create BIGINT NOT NULL,
|
||||
time_update BIGINT NOT NULL,
|
||||
reservation_start BIGINT NOT NULL,
|
||||
reservation_end BIGINT NOT NULL,
|
||||
validated BOOLEAN
|
||||
);
|
Reference in New Issue
Block a user