Skip to content
Erick Santos edited this page Apr 30, 2020 · 8 revisions

users

column name datatype details
id integer not null, primary key
username string not null, indexed, unique
first_name string not null, indexed
last_name string not null, indexed
email string not null, indexed, unique
bio text
age string not null
gender string not null
language string not null
region string not null
session_token string not null, indexed, unique
password_digest string not null
created_at datetime not null
updated_at datetime not null
  • index on username, unique: true
  • index on email, unique: true
  • index on session_token, unique: true
  • index on first_name
  • index on last_name

followings

column name datatype details
id integer not null, primary key
follower_id integer not null, indexed, foreign key
followed_id integer not null, indexed, foreign key
created_at datetime not null
updated_at datetime not null
  • follower_id references users
  • followed_id references users
  • index on [:follower_id, :followed_id]

boards

column name datatype details
id integer not null, primary key
user_id integer not null, indexed, foreign key
name string not null, indexed
description text
date_start datetime
date_end datetime
created_at datetime not null
updated_at datetime not null
  • user_id references users
  • index on [:user_id, :name], unique: true

pins

column name datatype details
id integer not null, primary key
user_id integer not null, indexed, foreign key
title string not null, indexed
description text
link text
created_at datetime not null
updated_at datetime not null
  • user_id references users
  • index on :user_id
  • index on :title

board_pins

column name datatype details
id integer not null, primary key
board_id integer not null, indexed, foreign key
pin_id integer not null, indexed, foreign key
created_at datetime not null
updated_at datetime not null
  • board_id references boards
  • pin_id references pins
  • index on [:board_id, :pin_id], unique: true

comments

column name datatype details
id integer not null, primary key
user_id integer not null, indexed, foreign key
pin_id integer not null, indexed, foreign key
content text not null
created_at datetime not null
updated_at datetime not null
  • user_id references users
  • pin_id references pins
  • index on [:user_id, :pin_id]
Clone this wiki locally