Skip to content

Database Schema

CodingInRhythm edited this page Apr 8, 2021 · 9 revisions

Database Schema


Here is what our villain table will look like:


Villains

Column name Data type Details
id integer not null, primary key, auto-increment
title string
firstName string not null
lastName string
userName string not null, unique
email string not null, unique
hashedPassword string not null
createdAt datetime not null
updatedAt datetime not null

Schemes

Column Name Data Type Details
id int primary key, auto-increment
name varchar not null, unique
villainId int not null, foreign key
createdAt timestamp not null
updatedAt timestamp not null
  • villainId references villains table

Ploys


column name data type details
id integer not null, primary key, auto-increment
name string not null
description string
completed boolean default: false
dueAt datetime not null
schemeId integer foreign key
createdAt datetime not null
updatedAt datetime not null
  • scheme_id references scheme table

Clone this wiki locally