Skip to content

Database Schema

Grant Russell edited this page Jan 10, 2022 · 16 revisions

users

column name data type details
id integer not null, primary key
name varchar(30) not null
username varchar(30) not null, unique
email varchar(256) not null, unique
hashedPassword varbinary not null
createdAt datetime not null
updatedAt datetime not null

images

column name data type details
id integer not null, primary key
userId integer not null, foreign key
albumId integer allow null, foreign key
imageUrl varchar not null
description text not null
createdAt datetime not null
updatedAt datetime not null

userId references users table, albumId references albums table, future feature

comments - future feature

column name data type details
id integer not null, primary key
userId integer not null, foreign key
imageId integer not null, foreign key
comment text not null
createdAt datetime not null
updatedAt datetime not null

userId references users table, imageId references images table

albums - future feature

column name data type details
id integer not null, primary key
userId integer not null, foreign key
title varchar not null
createdAt datetime not null
updatedAt datetime not null

userId references users table

Clone this wiki locally