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.2.0.rc2 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.1.3 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.2.0.rc1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.0.2.1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.1.2.1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.0.2 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.1.2 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-3.18.4 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.1.1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.1.0 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.0.1.2 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-3.18.3.1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.1.0.rc2.2 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.1.0.rc2.1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.0.1.1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-3.18.3 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.1.0.rc2 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.0.1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.1.0.rc1.1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.1.0.rc1 db/migrate/20180920171008_change_repository_password_to_text.rb