2021-06-01 12:20:20 +00:00
|
|
|
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
|
|
|
|
|
2018-06-11 07:28:03 +00:00
|
|
|
class AddUxFlowNextUpToMacros < ActiveRecord::Migration[5.1]
|
|
|
|
def change
|
2018-06-22 11:17:12 +00:00
|
|
|
|
|
|
|
# return if it's a new setup
|
2020-08-03 08:35:43 +00:00
|
|
|
return if !Setting.exists?(name: 'system_init_done')
|
2018-06-22 11:17:12 +00:00
|
|
|
|
2018-06-11 07:28:03 +00:00
|
|
|
add_column :macros, :ux_flow_next_up, :string, default: 'none', null: false
|
2018-06-22 11:17:12 +00:00
|
|
|
|
|
|
|
Macro.connection.schema_cache.clear!
|
|
|
|
Macro.reset_column_information
|
|
|
|
|
|
|
|
macro = Macro.find_by(name: 'Close & Tag as Spam')
|
|
|
|
return if !macro
|
2018-10-09 06:17:41 +00:00
|
|
|
|
2018-06-22 11:17:12 +00:00
|
|
|
macro.ux_flow_next_up = 'next_task'
|
|
|
|
macro.save!
|
2018-06-11 07:28:03 +00:00
|
|
|
end
|
|
|
|
end
|