Posts


Description

Posts table, a sub table extends Contents table.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id uuid 2147483647 null
PostShares.PostId PostShares_PostId_fkey N
Contents.id Posts_id_fkey C

Primary Key, also a Foreign key references Contents table, this is a sub table of Contents table.

UserId uuid 2147483647 null
Users.id Posts_UserId_fkey N

Foreign Key references Users table, author of the post.

type "gcud"."enum_Posts_type" 2147483647 null

Post type, enum_Posts_type.

title text 2147483647 null

Question title, only for question type post.

content jsonb 2147483647 null

Post content, a json object.

createdAt timestamptz 35,6 now()
updatedAt timestamptz 35,6 now()
GroupId uuid 2147483647 null
Groups.id Posts_GroupId_fkey R

foreign key, reference to gcud.“Groups”

status "gcud"."enum_Contents_status" 2147483647 'UNCATEGORIZED'::gcud."enum_Contents_status"

Indexes

Constraint Name Type Sort Column(s)
Posts_pkey Primary key Asc id
gcud_Posts_ContentHashtags_idx Performance
gcud_Posts_createdAt_idx Performance Asc createdAt
gcud_Posts_status_idx Performance Asc status
gcud_Posts_type_idx Performance Asc type
gcud_Posts_updatedAt_idx Performance Asc updatedAt
gcud_Posts_UserId_idx Performance Asc UserId
Posts_fullText_idx Performance
Posts_GroupId_createdAt_idx Performance Asc/Asc GroupId + createdAt
Posts_GroupId_idx Performance Asc GroupId
Posts_status_createdAt_idx Performance Asc/Desc status + createdAt
Posts_title_idx Performance Asc title

Check Constraints

Constraint Name Constraint
check_post_userid (((status = 'TRASH'::gcud."enum_Contents_status") OR ("UserId" IS NOT NULL)))
check_post_title ((((type = 'STANDARD'::gcud."enum_Posts_type") AND (title IS NULL)) OR ((type = 'QUESTION'::gcud."enum_Posts_type") AND (title IS NOT NULL))))

Relationships