Skip to content
celestialskyz edited this page Apr 6, 2020 · 14 revisions

Users

Column name Data type Details
Id int Not null, primary key, unique
email string Not null, unique
first_name string Not null, unique
last_name string Not null, unique
country string Not null, unique
password_digest string Not null
session_token string Not null, unique
created_at datetime Not null
updated_at datetime Not null
  • Index on email, unique:true *index on session_token, unique:true

Shows

Column name Data type Details
Id int Not null, primary key, unique
name string Not null
description string Not null, unique
cost float Not null
website string Not null
address string Not null, unique
city string Not null, unique
zip int Not null
phone_n int Not null, unique
max_cap int Not null
category string Not null
created_at datetime Not null
updated_at datetime Not null
  • Index on location, unique:true

#Showtimes

Column name Data type Details
Id int Not null, primary key, unique
time time Not null
show_id int Not null, foreign key
*Index on show_id

#Showings

Column name Data type Details
Id int Not null, primary key, unique
showtime int Not null, foreign key
show_id int Not null, foreign key
booking_id int not null, foreign key
*Index on show_id
*Index on showtime
*Index on booking_id

Bookings

Column name Data type Details
Id int Not null, primary key, unique
show_id int Foreign Key, Not null
reserver_id int Foreign Key, Not null
party_size int Not null
time time Not null
date date Not null
created_at datetime Not null
updated_at datetime Not null
  • Show_id references shows
  • Reserver_id references users *Index on show_id *Index on reserver_id

Reviews

Column name Data type Details
Id int Not null, primary key, unique
body string Not null
writer_id int Foreign Key, Not null
show_id int Foreign Key, Not null
stars int Not null
review_category int Not null
created_at datetime Not null
updated_at datetime Not null
  • Writer_id references users
  • Show_id references show *Index on Writer_id *index on Show_id
  • Index on [:writer, :show_id], unique:true

Favorites

Column name Data type Details
Id int Not null, primary key, unique
show_id int Foreign Key, Not null
user_id int Foreign Key, Not null
created_at datetime Not null
updated_at datetime Not null
  • Show_id references shows
  • User_id references users
  • Index on [:show_id, user_id] unique:true

Clone this wiki locally