topic_subscriptions table

The topic_subscriptions table in the Forum Database Schema schema has 5 columns, with 3 foreign keys to users, topics and posts.

last_read_post_id is a high-water mark, not a row per post read. Unread count is a range query above it.

Columns (5)

Columns of the topic_subscriptions table
ColumnTypeConstraintsDescription
user_iduuidnot null, references users.id
topic_iduuidnot null, references topics.id
levelsubscription_levelnot null
last_read_post_iduuidreferences posts.id
subscribed_attimestamptznot null

Indexes (1)

  • (topic_id, level)

Relationships

  • topic_subscriptions.user_id references users.id
  • topic_subscriptions.topic_id references topics.id
  • topic_subscriptions.last_read_post_id references posts.id