Skip to content

Postgres Database Schema

Catherine Vidos edited this page Sep 21, 2020 · 8 revisions

Welcome to the Pinteriors wiki!

users

column name data type details
id integer not null primary key
username string not null indexed, unique
email string not null indexed unique
first_name string
last_name string
gender string
password_digest string not null
session_token string not null indexed unique
created_at date, time not null
updated_at date, time not null
  • index on username, unique: true
  • index on email, unique: true
  • index on session_token, unique: true

boards

column name data type details
id integer not null primary key
title string not null
description string not null
user_id integer not null
created_at date, time not null
updated_at date, time not null
  • index on user_id

pins

column name data type details
id integer not null primary key
title string not null
description string not null
user_id integer not null
source_link string not null
created_at date, time not null
updated_at date, time not null
  • index on user_id

join_pins_boards

column name data type details
id integer not null primary key
pin_id string not null indexed unique
board_id string not null indexed unique
created_at date, time not null
updated_at date, time not null
  • index on pin_id, unique: true
  • index on board_id, unique: true

follow

column name data type details
id integer not null primary key
follower_id string not null indexed
following_id string not null indexed
created_at date, time not null
updated_at date, time not null
  • index on follower_id
  • index on following_id
Clone this wiki locally