Table "public.attachments" Column | Type | Collation | Nullable | Default --------------+--------------------------+-----------+----------+------------- id | uuid | | not null | chat_id | uuid | | not null | owner_id | uuid | | not null | filename | text | | not null | content_type | text | | not null | size_bytes | bigint | | not null | sha256 | text | | not null | object_key | text | | not null | status | text | | not null | variants | jsonb | | not null | '[]'::jsonb error_code | text | | | created_at | timestamp with time zone | | not null | updated_at | timestamp with time zone | | not null | Indexes: "attachments_pkey" PRIMARY KEY, btree (id) "attachments_chat_idx" btree (chat_id) "attachments_object_key_key" UNIQUE CONSTRAINT, btree (object_key) Foreign-key constraints: "attachments_chat_id_fkey" FOREIGN KEY (chat_id) REFERENCES chats(id) ON DELETE CASCADE "attachments_owner_id_fkey" FOREIGN KEY (owner_id) REFERENCES users(id) Referenced by: TABLE "message_attachments" CONSTRAINT "message_attachments_attachment_id_fkey" FOREIGN KEY (attachment_id) REFERENCES attachments(id) attachments | object_keys -------------+------------- 7 | 7 (1 row)