-
Notifications
You must be signed in to change notification settings - Fork 0
Schema
Steph Meyering edited this page Mar 6, 2020
·
15 revisions
column_name |
data_type |
details |
---|---|---|
id |
integer | not null, primary key |
username |
string | not null, indexed, unique |
email |
string | not null, indexed, unique |
location |
string | not null |
artist |
boolean | not null |
about |
text | |
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
- thoughts: create additional mini-profile-pic for use as comment icons
column_name |
data_type |
details |
---|---|---|
id |
integer | not null, primary key |
artist_id |
integer | not null, indexed, foreign key |
title |
string | not null |
genre |
string | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
artist_id
referencesusers
- index on
artist_id
column_name |
data_type |
details |
---|---|---|
id |
integer | not null, primary key |
author_id |
integer | not null, indexed, foreign key |
song_id |
integer | not null, indexed, foreign key |
song_timestamp |
integer | |
body |
string | max chars? |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
author_id
referencesusers
-
song_id
referencessongs
- index on
author_id
- index on
song_id
- thoughts: best datatype to store song_timestamp? datetime? integer?
column_name |
data_type |
details |
---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed, foreign key |
song_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
user_id
referencesusers
-
song_id
referencessongs
- index on
user_id
- index on
song_id