Messages table

The Messages table in the FitStack - V2 schema has 10 columns, keyed by Id, with 3 foreign keys to Conversations, Users and Messages.

Columns (10)

Columns of the Messages table
ColumnTypeConstraintsDescription
Iduuidprimary key, not null
ConversationIduuidnot null, references Conversations.Id
SenderUserIdtextnot null, references Users.IdCASCADE.
ReplyToMessageIduuidreferences Messages.IdSelf-reference, SET NULL.
Typeintegernot null`MessageContentType`.
Contenttextnot null
CreatedAttimestamp with time zonenot null
ModifiedAttimestamp with time zone
IsDeletedbooleannot null
DeletedAttimestamp with time zone

Indexes (1)

  • (ConversationId, CreatedAt) (IX_Messages_ConversationId_CreatedAt)

Relationships