mirror of
https://github.com/discourse/discourse.git
synced 2025-02-11 13:55:07 +00:00
The new `enforce_canonical_emails` site setting ensures that emails in the canonical form are unique. This mean that if `s.a.m+1@gmail.com` is registered `sam@gmail.com` will not be allowed. The commit contains a blanket "tag strip" (stripping everything after +) it also contains special handling of a "dot strip" for googlemail and gmail. The setting only impacts new registrations after `enforce_canonical_emails` The setting is default false so it will not impact any existing installs.
8 lines
270 B
Ruby
8 lines
270 B
Ruby
# frozen_string_literal: true
|
|
class AddCanonicalEmailToUserEmail < ActiveRecord::Migration[6.0]
|
|
def change
|
|
add_column :user_emails, :canonical_email, :string, length: 513
|
|
add_index :user_emails, :canonical_email, where: 'canonical_email IS NOT NULL'
|
|
end
|
|
end
|