20230125114758_issue4437_add_cleanup.rb 553 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue4437AddCleanup < 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. Scheduler.create_if_not_exists(
  7. name: "Clean up 'DataPrivacyTask'.",
  8. method: 'DataPrivacyTask.cleanup',
  9. period: 1.day,
  10. prio: 2,
  11. active: true,
  12. updated_by_id: 1,
  13. created_by_id: 1,
  14. last_run: Time.zone.now,
  15. )
  16. end
  17. end