Database Schema - John-Amini/AppOverflow Wiki

Users

Column name datatype details
id integer not null,primary key
username varchar not null,unique
email varchar not null, unique
hashed_password varchar not null
created_at timestamp not null
updated_at timestamp not null

Questions

Column name datatype details
id int primary key not null
title varchar not null, unique
content text not null
created_at timestamp not null
user_id int not null, foreign key
updated_at timestamp not null

Answers

Column name datatype details
id int primary key not null
content text not null
question_id int foreign key not null
user_id int foreign key not null

Votes

Column name datatype details
id int primary key not null
answer_id int foreign key not null
user_id int foreign key not null
vote boolean not null

Comments

Column name datatype details
id int primary key not null
answer_id int foreign key not null
user_id int foreign key not null
content text not null