Skip to content

Database Schema

Luke-Yamasaki edited this page Mar 7, 2022 · 15 revisions

Diagram

shuttr-db-schema-diagram

Users

There will be no usernames. Users will login with their email, and their first and last names will be incorporated into React components. (This will be implemented to prevent users from registering hundreds or thousands of usernames and finding ways to sell them to other members.)

column name data type details
id integer not null, primary key
firstName varchar not null
lastName varchar not null
email varchar not null, unique
age int not null
hashedPassword varchar not null
created_at timestamp not null
updated_at timestamp not null

Images

column name data type details
id integer not null, primary key
userId varchar not null
title varchar not null
description text
imageUrl varchar not null
created_at timestamp not null
updated_at timestamp not null

Comments

column name data type details
id integer not null, primary key
userId varchar not null
imageId varchar not null
content text
created_at timestamp not null
updated_at timestamp not null

Tags

Tags do not have a userId reference, but will have a created_at key-value pair. (This will be implemented to prevent users from registering hundreds or thousands of tags and finding ways to sell tag ownership to other members.)

column name data type details
id integer not null, primary key
title varchar not null
created_at timestamp not null

ImageTag

column name data type details
id integer not null, primary key
imageId int not null
userId int not null
Clone this wiki locally