mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 10:20:58 -06:00
25138db433
This commit promotes all post_deploy migrations which existed in Discourse v3.0.0 (timestamp <= 20221212234948)
20 lines
442 B
Ruby
20 lines
442 B
Ruby
# frozen_string_literal: true
|
|
#
|
|
class ConformBounceErrorCode < ActiveRecord::Migration[6.1]
|
|
def up
|
|
DB.exec(<<~SQL, regexp: '\d\.\d\.\d+|\d{3}')
|
|
UPDATE email_logs
|
|
SET bounce_error_code = (
|
|
SELECT array_to_string(
|
|
regexp_matches(bounce_error_code, :regexp),
|
|
''
|
|
)
|
|
) WHERE bounce_error_code IS NOT NULL;
|
|
SQL
|
|
end
|
|
|
|
def down
|
|
raise ActiveRecord::IrreversibleMigration
|
|
end
|
|
end
|