20220115125341_fix_account_warning_actions.rb 818 B

1234567891011121314151617181920212223
  1. # frozen_string_literal: true
  2. class FixAccountWarningActions < ActiveRecord::Migration[6.1]
  3. disable_ddl_transaction!
  4. def up
  5. safety_assured do
  6. execute 'UPDATE account_warnings SET action = 1000 WHERE action = 1'
  7. execute 'UPDATE account_warnings SET action = 2000 WHERE action = 2'
  8. execute 'UPDATE account_warnings SET action = 3000 WHERE action = 3'
  9. execute 'UPDATE account_warnings SET action = 4000 WHERE action = 4'
  10. end
  11. end
  12. def down
  13. safety_assured do
  14. execute 'UPDATE account_warnings SET action = 1 WHERE action = 1000'
  15. execute 'UPDATE account_warnings SET action = 2 WHERE action = 2000'
  16. execute 'UPDATE account_warnings SET action = 3 WHERE action = 3000'
  17. execute 'UPDATE account_warnings SET action = 4 WHERE action = 4000'
  18. end
  19. end
  20. end