conversations table
The conversations table in the Social Media Database Schema schema has 6 columns, keyed by id, with 1 foreign key to users. 3 columns in conversation_participants, messages and message_reads reference it.
last_message_at is denormalised so the inbox sorts without touching messages.
Columns (6)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| type | conversation_type | not null | |
| title | varchar(120) | ||
| created_by | uuid | not null, references users.id | |
| created_at | timestamptz | not null | |
| last_message_at | timestamptz |
Indexes (1)
(last_message_at)
Relationships
conversations.created_byreferencesusers.idconversation_participants.conversation_idreferencesconversationsmessages.conversation_idreferencesconversationsmessage_reads.conversation_idreferencesconversations