Sha256: 849a37f5e9681b4b5a16bc47c9c6b6fb19dd0253238fd668b0faa40df1c8d65c

Contents?: true

Size: 887 Bytes

Versions: 34

Compression:

Stored size: 887 Bytes

Contents

class UpdateDisconnectedSettings < ActiveRecord::Migration[6.0]
  class FakeSetting < Katello::Model
    self.table_name = 'settings'
  end

  def up
    setting_disconnected = FakeSetting.find_by(name: 'content_disconnected')
    setting = Setting.find_by(name: 'subscription_connection_enabled')

    setting&.update!(
      value: !setting_disconnected&.value
    )
    FakeSetting.where(:name => 'content_disconnected').delete_all
  end

  def down
    remove_column :katello_cdn_configurations, :airgapped
    setting_disconnected = Setting.find_by(name: 'subscription_connection_enabled')
    FakeSetting.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').delete_all
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
katello-4.15.0.rc2 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.15.0.rc1 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.14.1 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.14.0 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.14.0.rc3 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.14.0.rc2 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.14.0.rc1.1 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.14.0.rc1 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.13.1 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.13.0 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.12.1 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.13.0.rc1 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.12.0 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.12.0.rc3 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.12.0.rc2 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.12.0.rc1 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.11.1 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.11.0 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.11.0.rc2 db/migrate/20220110223754_update_disconnected_settings.rb
katello-4.11.0.rc1 db/migrate/20220110223754_update_disconnected_settings.rb