Shares


Columns

Column Type Size Nulls Auto Default Children Parents Comments
id uuid 2147483647 public.gen_random_uuid()
GroupShares.ShareId GroupShares_ShareId_fkey R
PostShares.ShareId PostShares_ShareId_fkey R
ExpertClassShares.ShareId ExpertClassShares_ShareId_fkey R
JobShares.ShareId JobShares_ShareId_fkey R
LiveRoomShares.ShareId LiveRoomShares_ShareId_fkey R
ShareSignUps.ShareId ShareSignUps_ShareId_fkey R
ShareVisitors.ShareId ShareVisitors_ShareId_fkey R
UserShares.ShareId UserShares_ShareId_fkey R
AnswerShares.ShareId AnswerShares_ShareId_fkey R
CommentShares.ShareId CommentShares_ShareId_fkey R
QuestionShares.ShareId QuestionShares_ShareId_fkey R
UserId uuid 2147483647 null
Users.id Shares_UserId_fkey R

Foreign key, referencing public.Users

method enum_Share_method 2147483647 null

method of sharing the post, but mobile is unable to know which method user is sharing, so this value is nullable for mobile

type enum_Share_type 2147483647 null

type of post shared

createdAt timestamptz 35,6 now()
postId uuid 2147483647 null

postId, since this refers to different tables, we are not able to use foreign key constraint on this column, but we still need this for unique constraint

platform enum_Share_platform 2147483647 'WEB'::"enum_Share_platform"

which platform the user share from

Indexes

Constraint Name Type Sort Column(s)
Shares_pkey Primary key Asc id
Shares_method_idx Performance Asc method
Shares_type_idx Performance Asc type
Shares_UserId_idx Performance Asc UserId
unique_UserId_method_type_postId_platform Must be unique Asc/Asc/Asc/Asc/Asc UserId + method + type + postId + platform

Relationships