schema - laamp/giftable-rails GitHub Wiki

Database Schema

users

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

lists

column name data type details
id integer primary key
title string not null
event_date datetime
owner_id integer foreign key, indexed, not null
timestamps datetime not null
  • owner_id references users table

gifts

column name data type details
id integer primary key
description string not null
gift_img string
purchased boolean not null, default false
creator_id integer foreign key, indexed, not null
recipient_id integer foreign key, indexed, not null
list_id integer foreign key, indexed, not null
timestamps datetime not null
  • creator_id references users table
  • recipient_id references users table
  • list_id references lists table

users_to_lists

column name data type details
id integer primary key
user_id integer foreign key, indexed, not null
list_id integer foreign key, indexed, not null
timestamps datetime not null
  • user_id references users table
  • list_id references lists table