mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
PERF: shift most user options out of the user table
As it stands we load up user records quite frequently on the topic pages, this in turn pulls all the columns for the users being selected, just to discard them after they are loaded New structure keeps all options in a discrete table, this is better organised and allows us to easily add more column without worrying about bloating the user table
This commit is contained in:
@@ -16,12 +16,15 @@ User.seed do |u|
|
||||
u.active = true
|
||||
u.admin = true
|
||||
u.moderator = true
|
||||
u.email_direct = false
|
||||
u.approved = true
|
||||
u.email_private_messages = false
|
||||
u.trust_level = TrustLevel[4]
|
||||
end
|
||||
|
||||
UserOption.where(user_id: -1).update_all(
|
||||
email_private_messages: false,
|
||||
email_direct: false
|
||||
)
|
||||
|
||||
Group.user_trust_level_change!(-1, TrustLevel[4])
|
||||
|
||||
# User for the smoke tests
|
||||
@@ -49,3 +52,4 @@ if ENV["SMOKE"] == "1"
|
||||
et.confirmed = true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user