Database Schema - DavidPhamThinkful/Life-Overflow Wiki

images/dbDiagram.png

Users

column name data type details
id integer not null, PK
username string(25) not null, unique
email string(255) not null, unique
hashedPassword binary string not null
createdAt datetime not null
updatedAt datetime not null

Categories

column name data type details
id integer not null, PK
name string(50) not null, unique
createdAt datetime not null
updatedAt datetime not null

Questions

column name data type details
id integer not null, PK
title string(255) not null
description text not null
userId integer not null, FK(User)
categoryId integer not null, FK(Category)
createdAt datetime not null
updatedAt datetime not null

Answers

column name data type details
id integer not null, PK
description text not null
userId integer not null, FK(User)
questionId integer not null, FK(Question)
createdAt datetime not null
updatedAt datetime not null

Votes

column name data type details
id integer not null, PK
value boolean not null
userId integer not null, FK(User)
answerId integer not null, FK(Answer)
createdAt datetime not null
updatedAt datetime not null