user_preferences table

The user_preferences table in the Reddit Clone Database Schema schema has 13 columns, keyed by user_id. 1 column in users references it.

default_sort is why sort_order is an enum rather than a query string constant: the chosen listing order is persisted state, not a UI detail. Every column here is read on the first render of every page, which is why it is a narrow table split away from the profile.

Columns (13)

Columns of the user_preferences table
ColumnTypeConstraintsDescription
user_iduuidprimary key
default_sortsort_ordernot null
default_comment_sortsort_ordernot null
themetheme_preferencenot null
languagevarchar(12)not null
show_nsfwbooleannot null
blur_nsfw_thumbnailsbooleannot null
search_includes_nsfwbooleannot null
autoplay_mediabooleannot null
reduce_animationsbooleannot null
open_links_in_new_tabbooleannot null
mark_messages_read_on_openbooleannot null
email_digest_enabledbooleannot null

Relationships