Skip to content

Database Schema

Dayton Chen edited this page Mar 9, 2022 · 9 revisions

[Database Diagram] https://dbdiagram.io/d/62287aaf61d06e6eadcd13c0 horrorHub

users

column name column type constraints
id integer not null, primary key
username varchar not null, unique
password string not null
emailAddress varchar not null, unique
created_at datetime not null
updated_at datetime not null

movies

column name column type constraints
id integer not null, primary key
title varchar not null
image varchar not null
year integer not null
country varchar not null
genre varchar not null
plot text not null

reviews

column name column type constraints
id integer not null, primary key
review text not null
rating numeric
created_at datetime not null
updated_at datetime not null
user_Id integer not null
movie_Id integer not null
  • user_Id references users table
  • movie_Id references movies table

watchlists

column name column type constraints
id integer not null, primary key
name varchar not null
user_Id integer not null
  • user_Id references users table

watchlistJoinMovies

column name column type constraints
id integer not null, primary key
movie_Id integer not null
watchlist_Id integer not null
  • movie_Id references movies table
  • watchlist_Id references watchlists table

countries

column name column type constraints
id integer not null, primary key
name varchar not null

countryJoinMovies

column name column type constraints
id integer not null, primary key
genre_Id integer not null
movie_Id integer not null
  • genre_Id references genres table
  • movie_Id references movies table

Clone this wiki locally