post_media table

The post_media table in the Reddit Clone Database Schema schema has 6 columns, keyed by id, with 2 foreign keys to posts and media_assets.

One row per gallery item, pointing at a reusable asset rather than a URL, so the same upload can be crossposted without being re-encoded.

Columns (6)

Columns of the post_media table
ColumnTypeConstraintsDescription
iduuidprimary key
post_iduuidnot null, references posts.id
media_asset_iduuidnot null, references media_assets.id
captionvarchar(300)
outbound_urlvarchar(2000)
positionsmallintnot null

Indexes (1)

  • (post_id, position)

Relationships