-
Notifications
You must be signed in to change notification settings - Fork 0
Database Schema
Manna edited this page Jul 19, 2021
·
12 revisions
column name | data type | details |
---|---|---|
id | integer | not null, PK |
username | string(50) | not null, unique |
string(255) | not null, unique | |
hashedPassword | string(255) | not null |
createdAt | date | not null |
updatedAt | date | not null |
- hasMany Comments
- hasMany Albums
column name | datatype | details |
---|---|---|
id | integer | not null, PK |
title | string(50) | not null |
userId | integer | not null, FK(Users) |
createdAt | date | not null |
updatedAt | date | not null |
- belongsTo Users
- belongsToMany Images through Joins
column name | datatype | details |
---|---|---|
id | integer | not null, PK |
title | string(50) | unique |
userId | integer | not null, FK(Users) |
imageUrl | string(255) | not null |
description | text | not null |
createdAt | date | not null |
updatedAt | date | not null |
- belongsToMany Albums through Joins
- belongsTo Users
- hasMany Comments
column name | datatype | details |
---|---|---|
id | integer | not null, PK |
imageId | integer | not null, FK(Images) |
albumId | integer | not null, FK(Albums) |
createdAt | date | not null |
updatedAt | date | not null |
- belongsTo Albums
- hasMany Images
column name | datatype | details |
---|---|---|
id | integer | not null, PK |
userId | integer | not null, FK(Users) |
imageId | integer | not null, FK(Images) |
comment | text | not null |
createdAt | date | not null |
updatedAt | date | not null |
- belongsTo Users
- belongsTo Images