Attachments


Description

Attachments table, a sub table extends Contents table to make attachment can be reacted to and replied to, a content record can has many attachments. An attachment cannot be attached to an attachment.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id uuid 2147483647 null
Contents.id Attachments_id_fkey C

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

ContentId uuid 2147483647 null
Contents.id Attachments_ContentId_fkey C

Foreign Key references Contents table, the content this attachment is attached to.

UserId uuid 2147483647 null
Users.id Attachments_UserId_fkey C

Foreign Key references Users table, author of the content which this attachment is attached to.

type "gcud"."enum_Attachments_type" 2147483647 null

Attachment type, enum_Attachments_type.

filename text 2147483647 null

Filename in our cloud storage.

createdAt timestamptz 35,6 now()
orderNumber int4 10 0

Order number of attachment

Indexes

Constraint Name Type Sort Column(s)
Attachments_pkey Primary key Asc id
gcud_Attachments_ContentId_idx Performance Asc ContentId

Check Constraints

Constraint Name Constraint
check_id_ContentId ((id <> "ContentId"))

Relationships