Skip to content

Database Schema

MonicaKornis edited this page Jan 30, 2018 · 8 revisions

Users

column name data type details
id integer primary key, not null, unique
email string not null, unique
password_digest string not null
session_token string not null

Recipes

column name data type details
id integer primary key, not null, unique
title string not null
description string not null
author_id integer foreign key, not null
ingredients string not null
cooking_time integer not null
img_url string not null

Comments

column name data type details
id integer primary key, not null, unique
body string not null
author_id integer foreign key, not null
recipe_id integer foreign key, not null
created_at datetime not null

Comment Likes

column name data type details
id integer primary key, not null, unique
user_id integer foreign key, not null
recipe_id integer foreign key, not null

Recipe Likes

column name data type details
id integer primary key, not null, unique
user_id integer foreign key, not null
recipe_id integer foreign key, not null

Recipe Ratings

column name data type details
id integer primary key, not null, unique
user_id integer foreign key, not null
rating integer not null, 1-5

Recipe Folders

column name data type details
id integer primary key, not null, unique
title string not null
description string not null
user_id integer foreign key, not null

Folder Recipes

column name data type details
id integer primary key, not null, unique
recipe_id integer foreign key, not null
recipe_folder_id integer foreign key, not null

Clone this wiki locally