Skip to content

Database Schema

Kevin Bartolome edited this page Apr 28, 2022 · 18 revisions

Schema of the PostgreSQL database

Associations

+ Users Table
  - fill in
  - fill in

+ Images Table
  - fill in
  - fill in

+ Comments Table
  - fill in
  - fill in

+ Favorites Table
  - fill in
  - fill in

+ Profile Table
  - fill in
  - fill in

users table

column names data type details
id integer PK, not null
username string(3, 256) unique, not null
email string(3, 30) unique, not null
hashedPassword string.binary unique, not null
  • username, unique: true
  • email, unique: true

images table

column names data type details
id integer PK, not null
imageURL string not null
userId integer foreign key
tags array not null, defaultValue = []
favoritedCount integer not null, defaultValue = 0
  • userId references users table
Clone this wiki locally