Schema - mboo1/Quora-Proj GitHub Wiki
users
Column Name | Datatype | Details |
---|---|---|
id | integer | not null, primary key |
username | string | not null, unique, indexed |
string | not null, unique, indexed | |
password_digest | string | not null |
session_token | string | not null, indexed, unique |
created_at | datetime | not null |
updated_at | datetime | not null |
questions
Column Name | Datatype | Details |
---|---|---|
id | integer | not null, primary key |
title | string | not null, indexed |
body | text | not null |
author_id | integer | not null, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |
- author_id references
users
answers
Column Name | Datatype | Details |
---|---|---|
id | integer | not null, primary key |
body | text | not null |
author_id | integer | not null, foreign key |
question_id | integer | not null, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |
- author_id references
users
- question_id references
questions
topics
Column Name | Datatype | Details |
---|---|---|
id | integer | not null, primary key |
title | string | not null, indexed, unique |
created_at | datetime | not null |
updated_at | datetime | not null |
topics/questions joins table
Column Name | Datatype | Details |
---|---|---|
topic_id | integer | not null, foreign key |
question_id | integer | not null, foreign key |
created_at | datetime | not null |
updated_at | datetime | not null |
- topic_id references
topics
- question_id references
questions