Skip to content

Database Schema

Minu Kim edited this page Mar 25, 2022 · 22 revisions

Database Schema

Database schema

Users

Column Name Data Type Details
id INTEGER primary key, not null
username VARCHAR(30) not null, unique
email VARCHAR(255) not null, unique
hashedPassword VARBINARY not null
profilePictureUrl VARCHAR(255)
bio VARCHAR(160)
displayName varchar(30)
dataSpent integer
trackCount integer
createdAt TIMESTAMP not null
updatedAt TIMESTAMP not null

Tracks

Column Name Data Type Details
id INTEGER not null, primary key
userId INTEGER not null, foreign key
trackUrl VARCHAR(255) not null, unique
artworkUrl VARCHAR(255) not null
title VARCHAR(100) not null
description VARCHAR(4000)
duration INTEGER in seconds, not null
fileSize INTEGER not null
commentCount INTEGER not null
playCount INTEGER not null
peakData JSON
createdAt TIMESTAMP not null
updatedAt TIMESTMAP not null
  • userId references Users

Comments

Column Name Data Type Details
id INTEGER not null, primary key
userId INTEGER not null, foreign key
trackId INTEGER not null, foreign key
body VARCHAR(280) not null
timePosted INTEGER not null
createdAt TIMESTAMP not null
updatedAt TIMESTAMP not null
  • userId references Users
  • trackId references Tracks
  • timePosted marks how long into a track's duration the comment was posted. Generated randomly if not specified by user
Clone this wiki locally