Sha256: e6f26f5ff312729dd60af6d58c67fca185a5a26461c8c95f73141e540f4e48a8

Contents?: true

Size: 949 Bytes

Versions: 9

Compression:

Stored size: 949 Bytes

Contents

class UpdateDisconnectedSettings < ActiveRecord::Migration[6.0]
  def up
    setting_disconnected = Setting.find_by(name: 'content_disconnected', category: 'Setting::Content')
    setting = Setting.find_by(name: 'subscription_connection_enabled', category: 'Setting::Content')

    setting&.update!(
      value: !setting_disconnected&.value
    )
    Setting.where(:name => 'content_disconnected', :category => 'Setting::Content').delete_all
  end

  def down
    remove_column :katello_cdn_configurations, :airgapped
    setting_disconnected = Setting.find_by(name: 'subscription_connection_enabled', category: 'Setting::Content')
    Setting.set('content_disconnected', N_("A server operating in disconnected mode does not communicate with the Red Hat CDN."),
               !setting_disconnected.value, N_('Disconnected mode'))

    Setting.where(:name => 'subscription_connection_enabled', :category => 'Setting::Content').delete_all
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
katello-4.4.2.2 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.4.2.1 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.4.2 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.4.1 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.4.0.2 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.4.0.1 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.4.0 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.4.0.rc2 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.4.0.rc1 db/migrate/20220110223754_update_disconnected_settings.rb