Skip to content

OrangeForum DB Schema

Sagar Gubbi edited this page Jun 1, 2021 · 27 revisions

Domains

id domain is_default forum_name edit_window user_activity_window max_num_activity auto_topic_close_days is_regular_signup_enabled no_regular_signup_msg signup_token is_readonly enable_group_sub enable_topic_autosub enable_comment_autosub
1 example.com False ExForo 20 2 5 60 True False True True True
2 forum.acad.ac True AcadForum 15 3 6 120 False Contact prof@acad.edu ddbqeww False True True True
  • no_regular_signup_msg is shown to the user if regular signup (by clicking on the sign-up button) is disabled and the user attempts to sign-up.
  • signup_token is used to create a special "unlisted" URL that can be sent to specific people (say via e-mail) for sign-ups. This is to prevent abuse from bots and to allow only trusted people to signup.
  • edit_window is the number of minutes after posting a topic / comment during which it can be edited by non-mod / non-admin users.
  • max_num_activity is the maximum number of posts a single user can make in user_activity_window minutes.
  • Close topic (make readonly) if inactive for auto_topic_close_days.

Users

id domain_id email username passwd_hash about is_superadmin is_topic_autosubscribe is_comment_autosubscribe is_email_notifications_disabled num_topics num_comments onetime_login_token onetime_login_token_at reset_token reset_at num_activity activity_at last_ip logout_at banned_at archived_at created_at updated_at
1 1 abc@xyz.com qwerty some-hash Meeee False True True False 10 10 NULL NULL 3 3-Apr-21 1.2.4.3 NULL NULL NULL 1-Jan-20 2-Feb-20
  • num_activity is the number of times the user has posted since activity_at. After a certain time window (say 15 minutes) has passed, num_activity is reset to zero.

Categories

id domain_id name description header_msg order num_topics is_restricted is_private is_readonly archived_at created_at updated_at
21 1 off topic misc discussions 2 13 False False False NULL 10-Jan-21 12-Jan-21
  • is_restricted means only white-listed users can write posts / comments.
  • is_private means only white-listed users can read / write posts / comments.

Topics

id title content user_id category_id is_sticky is_readonly num_comments num_views activity_at archived_at created_at updated_at
32 Topic name tada 1 21 False False 2 603 21-Jun-21 NULL 21-Apr-21 21-Apr-21

Comments

id content user_id topic_id is_sticky archived_at created_at updated_at
46 Halo 1 32 False NULL 1-May-21 2-May-21

Sub-comments

id content user_id comment_id archived_at created_at updated_at
89 Yeppie 1 46 NULL 3-May-21 4-May-21

Mods

id user_id category_id created_at
12 1 21 1-Apr-21

Admins

id user_id domain_id created_at
13 1 1 1-Apr-21

White-listed users

id user_id category_id created_at
92 1 21 12-Apr-21

Category subscriptions

id user_id topic_id unsub_token created_at
94 1 32 fasdjl 30-Apr-21

If a new topic is created, then all those subscribed to that category get an e-mail notification.

Topic subscriptions

id user_id topic_id unsub_token created_at
94 1 32 tyiuyiut 30-Apr-21

If a comment is posted on a tapic, then those subscribed to that topic get an e-mail notification. When a user creates a topic, he is automatically subscribed to that topic (but he can choose to unsubscribe).

Extra notes

id name content url created_at updated_at
41 privacy policy /priv 21-May-21 22-May-21

The extra notes appear as links at the bottom of the page.

Banned IPs

id domain_id ip created_at
48 1 194.2.3.* 30-Apr-21

Config

key value
smtp_host localhost
smtp_pass my_passwd
enable_email_notifications True
enable_anon_domain_creation False