mirror of
https://github.com/discourse/discourse.git
synced 2026-08-05 21:57:36 +08:00
14 lines
329 B
Ruby
Vendored
14 lines
329 B
Ruby
Vendored
# frozen_string_literal: true
|
|
class AnonymizeNormalizedEmailColumn < ActiveRecord::Migration[7.1]
|
|
def up
|
|
execute <<~SQL
|
|
UPDATE user_emails
|
|
SET normalized_email = email
|
|
WHERE SPLIT_PART(email, '@', 2) = 'anonymized.invalid'
|
|
SQL
|
|
end
|
|
|
|
def down
|
|
raise ActiveRecord::IrreversibleMigration
|
|
end
|
|
end
|