Discussion forum and community database schema

The phpBB and Discourse shape rather than the Reddit one: curated categories and boards, threads bumped by replies, flat numbered posts with quoting, reputation and badges, a report-driven moderation queue and private messages.

Forum Community ER diagram

Discussion forum and community database schema n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 n1 users idBIGINT usernameVARCHAR emailVARCHAR password_hashVARCHAR titleVARCHAR signatureVARCHAR avatar_urlVARCHAR post_countINTEGER reputationINTEGER joined_atDATETIME last_seen_atDATETIME stateVARCHAR suspended_untilDATETIME categories idBIGINT nameVARCHAR slugVARCHAR descriptionVARCHAR display_orderINTEGER is_collapsed_by_d…BOOLEAN boards idBIGINT category_idBIGINT nameVARCHAR slugVARCHAR descriptionVARCHAR display_orderINTEGER thread_countINTEGER post_countINTEGER last_post_atDATETIME min_read_levelSMALLINT min_post_levelSMALLINT is_lockedBOOLEAN board_moderators board_idBIGINT user_idBIGINT can_edit_postsBOOLEAN can_move_threadsBOOLEAN can_ban_usersBOOLEAN appointed_atDATETIME appointed_by_idBIGINT threads idBIGINT board_idBIGINT author_idBIGINT titleVARCHAR slugVARCHAR stateVARCHAR is_stickyBOOLEAN sticky_untilDATETIME view_countBIGINT reply_countINTEGER first_post_idBIGINT last_post_idBIGINT last_posted_atDATETIME created_atDATETIME posts idBIGINT thread_idBIGINT author_idBIGINT post_numberINTEGER bodyMEDIUMTEXT quoted_post_idBIGINT stateVARCHAR created_atDATETIME edited_atDATETIME edited_by_idBIGINT edit_reasonVARCHAR author_ipVARBINARY thread_subscriptions thread_idBIGINT user_idBIGINT subscribed_atDATETIME notify_modeVARCHAR last_read_post_nu…INTEGER last_notified_atDATETIME is_mutedBOOLEAN reputation_events idBIGINT user_idBIGINT granted_by_idBIGINT post_idBIGINT deltaINTEGER reasonVARCHAR event_typeVARCHAR created_atDATETIME badges idBIGINT codeVARCHAR nameVARCHAR descriptionVARCHAR tierVARCHAR icon_urlVARCHAR is_automaticBOOLEAN reputation_bonusINTEGER user_badges user_idBIGINT badge_idBIGINT awarded_atDATETIME awarded_by_idBIGINT is_featuredBOOLEAN reports idBIGINT reporter_idBIGINT post_idBIGINT thread_idBIGINT reported_user_idBIGINT reason_codeVARCHAR detailsVARCHAR stateVARCHAR claimed_by_idBIGINT created_atDATETIME resolved_atDATETIME moderation_actions idBIGINT moderator_idBIGINT report_idBIGINT action_typeVARCHAR target_post_idBIGINT target_thread_idBIGINT target_user_idBIGINT reasonVARCHAR duration_hoursINTEGER is_reversedBOOLEAN created_atDATETIME private_messages idBIGINT sender_idBIGINT recipient_idBIGINT parent_message_idBIGINT subjectVARCHAR bodyMEDIUMTEXT sent_atDATETIME read_atDATETIME sender_deletedBOOLEAN recipient_deletedBOOLEAN is_reportedBOOLEAN

Related database schemas