Pupfinder Schema - annkim10/pupfinder GitHub Wiki

Postgres Database Schema

users

column name data type details
id integer not null, primary key
first_name string not null
last_name string not null
zipcode integer not null
email string not null, indexed, unique
password_digest string not null
session_token string not null, indexed, unique
created_at datetime not null
updated_at datetime not null
  • Users have many favorites

rescue_orgs

column name data type details
id integer not null, primary key
org_name string not null, indexed
org_address string not null
org_email string not null
org_phone string not null
org_website string not null
org_bio text not null
  • Every rescue organization has many pups

pups

column name data type details
id integer not null, primary key
org_id integer not null, indexed, foreign key
pup_name string not null
pup_breed string not null
pup_size string not null
pup_gender string not null
pup_age string not null
pup_bio text not null
  • Each pup belongs to a rescue organization referenced by org_id

favorites

column name data type details
id integer not null, primary key
user_id integer not null, indexed, foreign key
pup_id integer not null, indexed, foreign key
created_at datetime not null
updated_at datetime not null
  • user_id references users
  • pup_id references pups