-
Notifications
You must be signed in to change notification settings - Fork 0
Database Schema
cch41 edited this page Apr 28, 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 |
| questiontagId | integer | not null, foreign key |
| 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 |
| userId | integer | not null, indexed, foreign key |
| questionId | integer | indexed, foreign key |
| answerId | integer | indexed, foreign key |
-
userIdreferencesuserstable -
questionIdreferencesquestionstable -
answerIdreferencesanswerstable - Unique index on
[userId, questionId] - Unique index on
[userId, answerId]
| 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