Database Schema - TylerRuby0821/WriteItDown GitHub Wiki
Schema for PostgresQL using Sequelize ORM
Users
column name |
data type |
details |
id |
integer |
not null, primary key |
username |
string |
not null, (Ununsed at this time) |
email |
string |
not null, indexed, unique |
hashedPassword |
string |
not null |
createdAt |
datetime |
not null |
updatedAt |
datetime |
not null |
- Unique index on Username
- Unique index on Email
NoteBooks
column name |
data type |
details |
Id |
integer |
not null, primary key |
userId |
integer |
not null, indexed, foreign key |
name |
string |
not null, unique |
createdAt |
datetime |
not null |
updatedAt |
datetime |
not null |
Notes
column name |
data type |
details |
Id |
integer |
not null, primary key |
notebookId |
integer |
not null, foreign key |
userId |
integer |
not null, indexed, foreign key |
title |
string |
not null |
noteContent |
TEXT |
not null |
createdAt |
datetime |
not null |
updatedAt |
datetime |
not null |
Note-Tags
column name |
data type |
details |
noteId |
integer |
not null, Foreign Key |
tagId |
integer |
not null, Foreign Key |
Tags
column name |
data type |
details |
tagId |
integer |
not null, PK |
userId |
integer |
not null, FK(Users Table) |
tagName |
string |
not null |