discourse-follow/db/post_migrate/20210920045747_rename_follow_plugin_preference.rb
2021-10-07 20:34:07 +03:00

19 lines
484 B
Ruby

# frozen_string_literal: true
class RenameFollowPluginPreference < ActiveRecord::Migration[6.1]
def up
DB.exec <<~SQL
UPDATE user_custom_fields ucf
SET name = 'notify_me_when_followed_creates_topic'
WHERE ucf.name = 'notify_me_when_followed_posts'
SQL
end
def down
DB.exec <<~SQL
UPDATE user_custom_fields ucf
SET name = 'notify_me_when_followed_posts'
WHERE ucf.name = 'notify_me_when_followed_creates_topic'
SQL
end
end