-
Notifications
You must be signed in to change notification settings - Fork 0
Database Schema
Minu Kim edited this page Feb 28, 2022
·
10 revisions
| Column Name | Data Type | Details |
|---|---|---|
| id | int | primary key, not null |
| username | varchar(30) | not null, unique |
| varchar(255) | not null, unique | |
| hashedPassword | varbinary | not null |
| createdAt | timestamp | not null |
| updatedAt | timestamp | not null |
| Column Name | Data Type | Details |
|---|---|---|
| id | int | primary key, not null |
| spotifyID | varchar(255) | unique |
| title | varchar(255) | not null |
| averageRating | float(3, 1) | not null, default = 0.0, max = 10.0 |
| ratingsCount | int | not null, default = 0 |
| artist | varchar(255) | not null |
| artworkURL | text | not null |
| releaseYear | int | not null |
| genres | text array | default = [] |
| createdAt | timestamp | not null |
| updatedAt | timestamp | not null |
-
spotifyIDis a base-62 identifier returned via the Spotify API
| Column Name | Data Type | Details |
|---|---|---|
| id | int | primary key, not null |
| userID | int | foreign key, not null |
| albumID | int | foreign key, not null |
| body | varchar(4000) | |
| listenedDate | dateonly | not null |
| rating | int | not null, min = 1, max = 10 |
| isRelisten | boolean | not null, default = false |
| createdAt | timestamp | not null |
| updatedAt | timestamp | not null |
-
userIDreferencesUsers.id -
albumIDreferencesAlbums.id
| Column Name | Data Type | Details |
|---|---|---|
| id | int | primary key, not null |
| userID | int | foreign key, not null |
| title | varchar(100) | not null |
| description | varchar(4000) | |
| isRanked | boolean | not null, default = false |
| createdAt | timestamp | not null |
| updatedAt | timestamp | not null |
-
userIDreferencesUsers.id
| Column Name | Data Type | Details |
|---|---|---|
| id | int | primary key, not null |
| albumID | int | foreign key, not null |
| listID | int | foreign key, not null |
| listIndex | int | |
| createdAt | timestamp | not null |
| updatedAt | timestamp | not null |
-
albumIDreferencesAlbums.id -
listIDreferencesLists.id
| Column Name | Data Type | Details |
|---|---|---|
| id | int | primary key, not null |
| userID | int | foreign key, not null |
| createdAt | timestamp | not null |
| updatedAt | timestamp | not null |
-
userIDreferencesUsers.id
| Column Name | Data Type | Details |
|---|---|---|
| id | int | primary key, not null |
| albumID | int | foreign key, not null |
| backlogID | int | foreign key, not null |
| createdAt | timestamp | not null |
| updatedAt | timestamp | not null |
-
albumIDreferencesAlbums.id -
backlogIDreferencesBacklogs.id
| Column Name | Data Type | Details |
|---|---|---|
| id | int | primary key, not null |
| spotifyID | varchar(255) | unique |
| name | varchar(255) | not null |
| imageURL | text | not null |
| createdAt | timestamp | not null |
| updatedAt | timestamp | not null |
- currently not implemented
-
spotifyIDis a base-62 identifier returned via the Spotify API
| Column Name | Data Type | Details |
|---|---|---|
| id | int | primary key, not null |
| spotifyID | varchar(255) | unique |
| albumID | int | foreign key, not null |
| title | varchar(255) | not null |
| durationMS | int | not null |
| createdAt | timestamp | not null |
| updatedAt | timestamp | not null |
- currently not implemented
-
albumIDreferencesAlbums.id -
spotifyIDis a base-62 identifier returned via the Spotify API
| Column Name | Data Type | Details |
|---|---|---|
| id | int | primary key, not null |
| userID | int | foreign key, not null |
| albumID | int | foreign key, not null |
| createdAt | timestamp | not null |
| updatedAt | timestamp | not null |
- join table to track albums a user has marked as 'listened'
-
userIDreferencesUsers.id -
albumIDreferencesAlbums.id
| Column Name | Data Type | Details |
|---|---|---|
| id | int | primary key, not null |
| userID | int | foreign key, not null |
| reviewID | int | foreign key, not null |
| body | varchar(500) | not null |
| createdAt | timestamp | not null |
| updatedAt | timestamp | not null |
-
userIDreferencesUsers.id -
reviewIDreferencesReviews.id
