Schema - mwei210/pixionary GitHub Wiki
Database Schema
users
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
username |
string | not null, indexed, unique |
email |
string | not null, indexed, unique |
session_token |
string | not null, unique |
password_digest |
string | not null |
name |
string | not null |
profile_photo_url |
text | |
bio |
text | |
created_at |
datetime | not null |
updated_at |
datetime | not null |
photos
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
url |
text | not null |
title |
string | |
description |
text | |
author_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
author_id
referencesusers
follows
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
follower_id |
integer | not null, indexed, foreign key |
following_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
follower_id
referencesusers
following_id
referencesusers
- index on
[:follower_id, :following_id], unique: true