Skip to content

Database Setup

yashiazize edited this page Aug 29, 2021 · 5 revisions

users

Column Name Datatype Constraints
id SERIAL PRIMARY KEY
email VARCHAR(100) unique
pw_hash TEXT not null
name VARCHAR(100) not null
is_chef BOOLEAN NOT NULL DEFAULT FALSE
cuisine TEXT not null
zip_code VARCHAR(5) not null
chef_img_url INT not null

bookings

Column Name Datatype Constraints
id SERIAL PRIMARY KEY not null
chef_id INT REFERENCES users (id) not null
user_id INT REFERENCES users (id) not null
status TEXT not null
cuisine TEXT not null
event_date DATE not null
start_time TIME not null
end_time TIME not null

ratings

Column Name Datatype Constraints
rating NUMERIC NOT NULL CHECK (rating >=0 AND rating <= 5)
booking_id INT f_key: ref (bookings.id)

Clone this wiki locally