20180611070839_add_ux_flow_next_up_to_macros.rb 467 B

123456789101112131415161718
  1. class AddUxFlowNextUpToMacros < ActiveRecord::Migration[5.1]
  2. def change
  3. # return if it's a new setup
  4. return if !Setting.exists?(name: 'system_init_done')
  5. add_column :macros, :ux_flow_next_up, :string, default: 'none', null: false
  6. Macro.connection.schema_cache.clear!
  7. Macro.reset_column_information
  8. macro = Macro.find_by(name: 'Close & Tag as Spam')
  9. return if !macro
  10. macro.ux_flow_next_up = 'next_task'
  11. macro.save!
  12. end
  13. end