-
Notifications
You must be signed in to change notification settings - Fork 0
Database Schema
1stepremoved edited this page Dec 28, 2017
·
16 revisions
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
username |
string | not null, indexed, unique |
email |
string | not null, indexed, unique |
image_url |
string | not null |
password_digest |
string | not null |
session_token |
string | not null, indexed, unique |
created_at |
datetime | not null |
updated_at |
datetime | not null |
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
mp4_data |
bit varying | not null, primary key |
title |
string | not null, indexed |
description |
text | |
user_id |
integer | not null, indexed |
playlist_id |
integer | indexed |
playlist_ord |
integer | |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
user_idreferencesusers -
playlist_idreferencesplaylists - Index on
[:playlist_id, :playlist_ord], unique: true
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
title |
string | not null, indexed |
description |
text | |
image_url |
string | not null |
user_id |
integer | not null, indexed |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
user_idreferencesusers - Index on
[:user_id, :title_id], unique: true
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
body |
text | not null |
user_id |
integer | not null, indexed |
timestamp |
integer | |
track_id |
integer | indexed |
playlist_id |
integer | indexed |
parent_comment_id |
integer | indexed |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
user_idreferencesusers -
track_idreferencestracks -
playlist_idreferencesplaylists -
parent_comment_idreferencescomments - Constraint so that only one of
track_idandplaylist_idis not null
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
follower_id |
integer | not null, indexed |
followee_id |
integer | not null, indexed |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
follower_idandfollowee_idreferencesusers - Index on
[:follower_id, :followee_id], unique: true
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed |
track_id |
integer | indexed |
playlist_id |
integer | indexed |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
user_idreferencesusers -
track_idreferencestracks -
playlist_idreferencesplaylists - Index on
[:user_id, :track_id], unique: true - Index on
[:user_id, :playlist_id], unique: true - Constraint so that only one of
track_idandplaylist_idis not null
| column name | data type | details |
|---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed |
track_id |
integer | indexed |
playlist_id |
integer | indexed |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
user_idreferencesusers -
track_idreferencestracks -
playlist_idreferencesplaylists - Index on
[:user_id, :track_id], unique: true - Index on
[:user_id, :playlist_id], unique: true - Constraint so that only one of
track_idandplaylist_idis not null