20201028095957_issue_3215_rename_existing_office365.rb 598 B

12345678910111213141516
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class Issue3215RenameExistingOffice365 < ActiveRecord::Migration[5.2]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. # migrate existing Channels and ExternalCredential to new name
  7. # rubocop:disable Rails/SkipsModelValidations
  8. Channel.where(area: 'Office365::Account').update_all(area: 'Microsoft365::Account')
  9. ExternalCredential.where(name: 'office365').update_all(name: 'microsoft365')
  10. # rubocop:enable Rails/SkipsModelValidations
  11. end
  12. end