saved_items table

The saved_items table in the Reddit Clone Database Schema schema has 5 columns, with 1 foreign key to users.

A join table rather than a flag, so saving survives the post being removed and the saved tab can still show that something was there.

Columns (5)

Columns of the saved_items table
ColumnTypeConstraintsDescription
user_iduuidnot null, references users.id
content_typecontent_typenot null
content_iduuidnot null
categoryvarchar(50)
saved_attimestamptznot null

Indexes (1)

  • (user_id, saved_at)

Relationships

  • saved_items.user_id references users.id