Skip to content

Database Schema

AmMonsoon edited this page Jul 26, 2021 · 12 revisions

Image of database schema
App_Overload DB Diagram

Users

column name data type details
id integer not null, primary key
firstName varchar not null
lastName varchar not null
username varchar not null
password varchar not null
reputation integer not null
avatar_url varchar not null
email varchar not null , unique
created_at datetime not null
updated-at datetime not null

Questions

column name data type details
id integer not null, primary key
title varchar not null
details text not null
votes integer not null
viewCount integer not null
user_id integer not null
created_at datetime not null
updated-at datetime not null
  • user_id references Users

questionComments

column name data type details
id integer not null, primary key
comment text not null
votes integer not null
question_id integer not null
user_id integer not null
  • question_id references Questions table
  • user_id references Users table

Answers

column name data type details
id integer not null, primary key
answer text not null
votes integer not null
question_id integer not null
user_id integer not null
created_at datetime not null
updated-at datetime not null
  • question_id references Questions table
  • user_id references Users table

answerComments

column name data type details
id integer not null, primary key
comment text not null
votes integer not null
answer_id integer not null
user_id integer not null
  • answer_id references Answers table
  • user_id references Users table

Tags*

column name data type details
id integer not null, primary key
name varchar not null
description text not null
numQuestions integer not null
numFollowers integer not null

tagUsers*

column name data type details
id integer not null, primary key
user_id integer not null
tag_id integer not null
  • user_id references Users table
  • tag_id references Tags table

tagQuestions*

column name data type details
id integer not null, primary key
question_id integer not null
tag_id integer not null
  • question_id references Questions table
  • tag_id references Tags table

Clone this wiki locally