Database Schema - jstnswn/Project-CoFi Wiki

Database Schema

Users

Column Type Data Type Details
id integer primary key, unique, not null
username string(30) not null, unique
email string(256) not null, unique
hashedPassword string not null
created_at datetime not null
updated_at datetime not null

Artists

Column Type Data Type Details
id integer primary key, unique, not null
name string not null
created_at datetime not null
updated_at datetime not null

Albums

Column Type Data Type Details
id integer primary key, unique, not null
title string(50) not null
artistId integer foreign key
userId integer foreign key
imageURL string
likeCount integer foreign key, not null, default 0
created_at datetime not null
updated_at datetime not null

Songs

Column Type Data Type Details
id integer primary key, unique, not null
title string(50) not null, default 'untitled'
userId integer foreign key
artistId integer not null, foreign key
albumId integer foreign key
songURL string not null
imageURL string
likeCount integer default 0
trackNumber integer
userId integer foreign key, not null
created_at datetime not null
updated_at datetime not null