discourse/db/migrate/20220505133851_migrate_cust...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
410 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class MigrateCustomGroupDeletionLogs < ActiveRecord::Migration[7.0]
def up
DB.exec(<<~SQL, group_deleted_id: 99, custom_action_id: 23)
UPDATE user_histories
SET action = :group_deleted_id, custom_type = NULL
WHERE action = :custom_action_id AND custom_type = 'delete_group'
SQL
end
def down
raise ActiveRecord::IrreversibleMigration
end
end