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 not null
last_name string not null
gender char not null
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

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

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

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
Clone this wiki locally