DeletedPosts


Description

Deleted Posts table, a post copy with deleted reason when it is deleted by the group admin

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id uuid 2147483647 null
DeletedPostNotifications.DeletedPostId DeletedPostNotifications_DeletedPostId_fkey R

Primary Key.

UserId uuid 2147483647 null
Users.id DeletedPosts_UserId_fkey C

Foreign Key references Users table, author of the post.

DeleteUserId uuid 2147483647 null
Users.id DeletedPosts_DeleteUserId_fkey C

Foreign Key references Users table, the user who deletes the post.

GroupId uuid 2147483647 null
Groups.id DeletedPosts_GroupId_fkey C

foreign key, reference to gcud.“GroupTypes”.

type "gcud"."enum_Posts_type" 2147483647 null

Deleted Post type.

title text 2147483647 null

Deleted Question title, only for question type post.

content jsonb 2147483647 null

Deleted Post content, a json object.

createdAt timestamptz 35,6 now()
updatedAt timestamptz 35,6 now()
reason enum_DeletedPosts_reason 2147483647 null

Deleted reason.

note text 2147483647 null

Deleted note, addition description.

Indexes

Constraint Name Type Sort Column(s)
DeletedPosts_pkey Primary key Asc id
gcud_DeletedPosts_createdAt_idx Performance Asc createdAt
gcud_DeletedPosts_GroupId_idx Performance Asc GroupId
gcud_DeletedPosts_reason_idx Performance Asc reason
gcud_DeletedPosts_type_idx Performance Asc type
gcud_DeletedPosts_UserId_idx Performance Asc UserId

Check Constraints

Constraint Name Constraint
check_post_note (((reason <> 'OTHER'::"enum_DeletedPosts_reason") OR ((reason = 'OTHER'::"enum_DeletedPosts_reason") AND (note 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