mirror of
https://github.com/discourse/discourse.git
synced 2026-07-29 15:54:48 -05:00
FEATURE: Add email normalization rules setting (#14593)
When this setting is turned on, it will check that normalized emails are unique. Normalized emails are emails without any dots or plus aliases. This setting can be used to block use of aliases of the same email address.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddNormalizedEmailToUserEmail < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :user_emails, :normalized_email, :string
|
||||
execute "CREATE INDEX index_user_emails_on_normalized_email ON user_emails (LOWER(normalized_email))"
|
||||
end
|
||||
|
||||
def down
|
||||
execute "DROP INDEX index_user_emails_on_normalized_email"
|
||||
drop_column :user_emails, :normalized_email, :string
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user