Skip to content

Database Schema

Tran Le edited this page May 30, 2021 · 10 revisions

Puppr-Schema

Users

column name data type details
id int not null, primary key
firstName string not null
lastName string not null
username string not null, unique
email string not null, unique
hashedPassword string not null
createdAt timestamp not null
updatedAt timestamp not null

Photos

column name data type details
id int not null, primary key
title string not null
caption string
imgURL string not null
userId int not null
createdAt timestamp not null
updatedAt timestamp not null
  • userId references Users table

Albums

column name data type details
id int not null, primary key
name string not null
description string
userId int not null
createdAt timestamp not null
updatedAt timestamp not null
  • userId references Users table

AlbumPhotos

column name data type details
id int not null, primary key
photoId int not null
albumId int not null
createdAt timestamp not null
updatedAt timestamp not null
  • photoId references Photos table
  • albumId references Albums table

Comments

column name data type details
id int not null, primary key
body string not null
userId int not null
photoId int not null
createdAt timestamp not null
updatedAt timestamp not null
  • userId references Users table
  • photoId references Photos table

Clone this wiki locally