wiki_pages table

The wiki_pages table in the Reddit Clone Database Schema schema has 9 columns, keyed by id, with 2 foreign keys to subreddits and users. 1 column in wiki_page_editors references it.

Wiki content is versioned through content_revisions like every other body of text in this schema, rather than getting a bespoke history table of its own.

Columns (9)

Columns of the wiki_pages table
ColumnTypeConstraintsDescription
iduuidprimary key
subreddit_iduuidnot null, references subreddits.id
slugvarchar(200)not null
content_mdtextnot null
permissionwiki_permissionnot null
is_listedbooleannot null
revision_countintegernot null
last_edited_byuuidreferences users.id
updated_attimestamptznot null

Indexes (1)

  • (subreddit_id, slug) unique

Relationships