-
Notifications
You must be signed in to change notification settings - Fork 0
Database Schema
jjiiaaLi edited this page May 5, 2021
·
10 revisions
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| username | string | not null, unique |
| string | not null, indexed, unique | |
| hashedPassword | string | not null, unique |
| created_at | datetime | not null |
| updated-at | datetime | not null |
- index on
email, unique: true
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| content | string | not null |
| userId | integer | not null, foreign key |
| created_at | datetime | not null |
| updated-at | datetime | not null |
-
userIdreferencesuserstable -
questiontagIdreferencesquestiontagstable
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| content | string | not null |
| userId | integer | not null, foreign key |
| questionId | integer | not null, foreign key |
| created_at | datetime | not null |
| updated-at | datetime | not null |
-
userIdreferencesuserstable -
questionIdreferencesquestionstable
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| content | string | not null |
| userId | integer | not null, foreign key |
| answerId | integer | not null, foreign key |
| questionId | integer | not null, foreign key |
| created_at | datetime | not null |
| updated-at | datetime | not null |
-
userIdreferencesuserstable -
questionIdreferencesquestionstable -
answerIdreferencesanswerstable
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| userId | integer | not null, indexed, foreign key |
| questionId | integer | indexed, foreign key |
| answerId | integer | indexed, foreign key |
| commentId | integer | indexed, foreign key |
-
userIdreferencesuserstable -
questionIdreferencesquestionstable -
answerIdreferencesanswerstable -
commentIdreferencesanswerstable
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| name | text | not null |
| column name | data type | details |
|---|---|---|
| id | integer | not null, primary key |
| questionId | integer | not null, foreign key |
| tagId | integer | not null, foreign key |
-
questionIdreferencesquestionstable -
tagIdreferencestagstable