Skip to content

Database Schema

Parker Bolick edited this page Oct 11, 2021 · 2 revisions

Image of Schema

Users

Column Name Data Type Details
id integer not null, primary key
username string not null, unique
email string
hashedPassword string not null
createdAt timestamp not null
updatedAt timestamp not null
  • index on email, unique: true

Notes

Column Name Data Type Details
id integer not null, primary key
userId integer not null, foreign key
notebookId integer foreign key
title string not null
content string not null
createdAt timestamp not null
updatedAt timestamp not null
  • userId references Users table
  • notebookId references Notebooks table

Notebooks

Column Name Data Type Details
id integer not null, primary key
title string not null
userId integer not null, foreign key
createdAt timestamp not null
updatedAt timestamp not null
  • userId references Users table

Tags

Column Name Data Type Details
id integer not null, primary key
userId integer not null, foreign key
noteId integer not null, foreign key
title string not null
createdAt timestamp not null
updatedAt timestamp not null
  • userId references Users table
  • noteId references Notes table

Clone this wiki locally