20201028095957_issue_3215_rename_existing_office365.rb 521 B

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