20220405093706_timeplan_nightly.rb 791 B

1234567891011121314151617181920212223242526272829303132
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class TimeplanNightly < ActiveRecord::Migration[6.1]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. add_column :schedulers, :timeplan, :string, limit: 2500, null: true
  7. Scheduler.reset_column_information
  8. Scheduler.find_by(name: 'Clean up cache.').update(
  9. period: 10.minutes,
  10. timeplan: {
  11. 'days' => {
  12. 'Mon' => true,
  13. 'Tue' => true,
  14. 'Wed' => true,
  15. 'Thu' => true,
  16. 'Fri' => true,
  17. 'Sat' => true,
  18. 'Sun' => true
  19. },
  20. 'hours' => {
  21. '23' => true
  22. },
  23. 'minutes' => {
  24. '0' => true
  25. }
  26. }
  27. )
  28. end
  29. end