Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | uuid | 2147483647 | public.gen_random_uuid() |
|
|
primary key |
||||||||||||||||||||||||||
| UserId | uuid | 2147483647 | null |
|
|
foreign key, refer to user |
||||||||||||||||||||||||||
| createdAt | timestamptz | 35,6 | now() |
|
|
created time |
||||||||||||||||||||||||||
| updatedAt | timestamptz | 35,6 | now() |
|
|
updated time |
||||||||||||||||||||||||||
| title | varchar | 255 | null |
|
|
question title |
||||||||||||||||||||||||||
| content | text | 2147483647 | null |
|
|
question detail, we might store json string here, the reason why we don’t use jsonb is graphql is strong type, cannot return any |
||||||||||||||||||||||||||
| shortId | bpchar | 8 | null |
|
|
shortId, this is for shortening url, kind of primary key but we don’t want to break the uuid convention on primary key |
||||||||||||||||||||||||||
| deletedAt | timestamptz | 35,6 | √ | null |
|
|
||||||||||||||||||||||||||
| views | int4 | 10 | 0 |
|
|
|||||||||||||||||||||||||||
| tsv | tsvector | 2147483647 | √ | null |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| Questions_pkey | Primary key | Asc | id |
| qn_ans_Questions_createdAt_idx | Performance | Asc | createdAt |
| qn_ans_questions_tsv_idx | Performance | Asc | tsv |
| qn_ans_Questions_UserId_idx | Performance | Asc | UserId |
| Questions_shortId_key | Must be unique | Asc | shortId |

