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)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| subreddit_id | uuid | not null, references subreddits.id | |
| slug | varchar(200) | not null | |
| content_md | text | not null | |
| permission | wiki_permission | not null | |
| is_listed | boolean | not null | |
| revision_count | integer | not null | |
| last_edited_by | uuid | references users.id | |
| updated_at | timestamptz | not null |
Indexes (1)
(subreddit_id, slug)unique
Relationships
wiki_pages.subreddit_idreferencessubreddits.idwiki_pages.last_edited_byreferencesusers.idwiki_page_editors.wiki_page_idreferenceswiki_pages