Sha256: 5779ae97093fa6b649e5bdb6f36e3703f7a72b9d76ba0ed3b9e3962611a067a4

Contents?: true

Size: 621 Bytes

Versions: 181

Compression:

Stored size: 621 Bytes

Contents

class ChangeRepositoryPasswordToText < ActiveRecord::Migration[5.2]
  def up
    change_column :katello_repositories, :upstream_password, :text
  end

  def down
    add_column :katello_repositories, :temp_upstream_password, :string, :limit => 1024

    Katello::Repository.find_each do |repo|
      next if repo.upstream_password.blank?
      repo.update_column(:temp_upstream_password, repo.upstream_password.length > 1024 ? nil : repo.upstream_password)
    end

    remove_column :katello_repositories, :upstream_password
    rename_column :katello_repositories, :temp_upstream_password, :upstream_password
  end
end

Version data entries

181 entries across 181 versions & 1 rubygems

Version Path
katello-4.11.0.rc2 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.11.0.rc1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.10.0 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.9.2 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.10.0.rc2 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.10.0.rc1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.8.4 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.9.1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.8.3 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.9.0 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.7.6 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.8.2 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.9.0.rc2 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.9.0.rc1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.8.1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.7.5 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.8.0 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.8.0.rc2 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.7.4 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.8.0.rc1 db/migrate/20180920171008_change_repository_password_to_text.rb