reposts table

The reposts table in the Social Media Database Schema schema has 5 columns, keyed by id, with 2 foreign keys to posts and users.

A null comment is a plain repost; a non-null one is a quote. Both fan out to followers.

Columns (5)

Columns of the reposts table
ColumnTypeConstraintsDescription
iduuidprimary key
post_iduuidnot null, references posts.id
user_iduuidnot null, references users.id
commentvarchar(2000)
created_attimestamptznot null

Indexes (2)

  • (post_id, user_id) unique
  • (user_id, created_at)

Relationships