-
Notifications
You must be signed in to change notification settings - Fork 0
Database Schema
schen13 edited this page Aug 13, 2018
·
9 revisions
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
username |
string | not null, indexed, unique |
fname |
string | not null |
lname |
string | 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 |
- index on
:username, unique: true
- index on
:email, unique: true
- index on
:session_token, unique: true
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed, foreign key |
title |
string | not null |
description |
text | optional |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
user_id
referencesusers
- index on
:user_id
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed, foreign key |
url |
string | not null |
description |
text | optional |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
user_id
referencesusers
- index on
:user_id
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
followee_id |
integer | not null, foreign key |
follower_id |
integer | not null, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
followee_id
referencesusers
-
follower_id
referencesusers
- index on
[:follower_id, :followee_id], unique: true
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
board_id |
integer | not null, foreign key |
pin_id |
integer | not null, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |
-
board_id
referencesboards
-
pin_id
referencespins
- index on
[:board_id, :pin_id], unique: true