20220115125341_fix_account_warning_actions.rb 787 B

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