Skip to content

Database Schema

Dale Sakamoto edited this page Dec 28, 2020 · 2 revisions

Users table

column name data type details
id integer not null, primary key
username string(50) not null, unique
email string(50) not null, unique
hashedPassword binary string not null
avatar string(255)
description string(255)
createdAt datetime not null
updatedAt datetime not null
  • both avatar and description are designed for future expansion of the user profile to set their own picture and brief "about"
  • unique index on username
  • unique index on email
  • Sequelize hasMany Routes association

Routes table

column name data type details
id integer not null, primary key
name string(100) not null
startPoint integer not null
endPoint integer not null
distance integer
description string(255)
userId integer not null, foreign key
createdAt datetime not null
updatedAt datetime not null
  • userId references Users table
  • Sequelize belongsToMany Users association
Clone this wiki locally