mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 05:29:17 -06:00
20 lines
561 B
Ruby
20 lines
561 B
Ruby
class RemoveCensoredPatternSiteSetting < ActiveRecord::Migration[5.1]
|
|
def up
|
|
execute <<~SQL
|
|
INSERT INTO user_histories
|
|
(action, acting_user_id, subject, previous_value,
|
|
new_value, admin_only, created_at, updated_at)
|
|
SELECT 3, -1, 'censored_pattern', value, '', true, now(), now()
|
|
FROM site_settings
|
|
WHERE name = 'censored_pattern'
|
|
AND value != ''
|
|
SQL
|
|
|
|
execute "DELETE FROM site_settings WHERE name = 'censored_pattern'"
|
|
end
|
|
|
|
def down
|
|
raise ActiveRecord::IrreversibleMigration
|
|
end
|
|
end
|