Questions


Columns

Column Type Size Nulls Auto Default Children Parents Comments
id uuid 2147483647 public.gen_random_uuid()
Answers.QuestionId Answers_QuestionId_fkey C
Polls.QuestionId Polls_QuestionId_fkey C
QuestionBookmarks.QuestionId QuestionBookmarks_QuestionId_fkey C
QuestionCategories.QuestionId QuestionCategories_QuestionId_fkey C
QuestionImages.QuestionId QuestionImages_QuestionId_fkey C
QuestionShares.QuestionId QuestionShares_QuestionId_fkey R
QuestionUpvotes.QuestionId QuestionUpvotes_QuestionId_fkey C
QuestionViews.QuestionId QuestionViews_QuestionId_fkey C

primary key

UserId uuid 2147483647 null
Users.id Questions_UserId_fkey R

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

Relationships