Database Schema - StevenBarnett1/Group_Project GitHub Wiki
Users
Column name |
data type |
details |
id |
integer |
not null, primary key |
username |
string |
not null |
password |
string |
not null |
email |
string |
not null, index, unique |
created_at |
datetime |
not null |
updated_at |
datetime |
not null |
- index on
email, unique: true
Questions
Column name |
data type |
details |
id |
integer |
not null, primary key |
body |
text |
not null |
userId |
integer |
not null, foreign key |
userId
references users
table
Votes
Column name |
data type |
details |
id |
integer |
not null, primary key |
userId |
integer |
not null, foreign key |
voteType |
boolean |
not null |
questionId |
integer |
not null, foreign key |
questionId
references questions
table
userId
references users
table
answers
Column name |
data type |
details |
id |
integer |
not null, primary key |
body |
text |
not null |
questionId |
integer |
not null, foreign key |
userId |
integer |
not null, foreign key |
questionId
references questions
table
userId
references questions
table
comments
Column name |
data type |
details |
id |
integer |
not null, primary key |
body |
text |
not null |
answerId |
integer |
not null, foreign key |
userId |
integer |
not null, foreign key |
answerId
references answers
table
userId
references users
table