diff --git a/db/migrate/20220127135317_scheduler_updates2.rb b/db/migrate/20220127135317_scheduler_updates2.rb new file mode 100644 index 000000000..f96886b6a --- /dev/null +++ b/db/migrate/20220127135317_scheduler_updates2.rb @@ -0,0 +1,26 @@ +# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/ + +class SchedulerUpdates2 < ActiveRecord::Migration[6.0] + def change + return if !Setting.exists?(name: 'system_init_done') + + schedulers_update = [ + { + name: "Clean up 'Cti::Log'.", + method: 'Cti::Log.cleanup', + }, + ] + + schedulers_update.each do |scheduler| + fetched_scheduler = Scheduler.find_by(method: scheduler[:method]) + next if !fetched_scheduler + + if scheduler[:name] + # p "Updating name of #{scheduler[:name]} to #{scheduler[:name]}" + fetched_scheduler.name = scheduler[:name] + end + + fetched_scheduler.save! + end + end +end diff --git a/db/seeds/schedulers.rb b/db/seeds/schedulers.rb index 6a8af0380..ac6b852b5 100644 --- a/db/seeds/schedulers.rb +++ b/db/seeds/schedulers.rb @@ -175,7 +175,7 @@ Scheduler.create_if_not_exists( created_by_id: 1, ) Scheduler.create_if_not_exists( - name: __("Clean up 'Cti::Log.'"), + name: __("Clean up 'Cti::Log'."), method: 'Cti::Log.cleanup', period: 1.month, prio: 2, diff --git a/i18n/zammad.pot b/i18n/zammad.pot index bcb61a1b8..5be6ca3dc 100644 --- a/i18n/zammad.pot +++ b/i18n/zammad.pot @@ -1671,7 +1671,7 @@ msgid "City" msgstr "" #: db/seeds/schedulers.rb -msgid "Clean up 'Cti::Log.'" +msgid "Clean up 'Cti::Log'." msgstr "" #: db/seeds/schedulers.rb