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.14.2 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.15.0 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.15.0.rc2 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.15.0.rc1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.14.1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.14.0 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.14.0.rc3 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.14.0.rc2 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.14.0.rc1.1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.14.0.rc1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.13.1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.13.0 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.12.1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.13.0.rc1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.12.0 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.12.0.rc3 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.12.0.rc2 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.12.0.rc1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.11.1 db/migrate/20180920171008_change_repository_password_to_text.rb
katello-4.11.0 db/migrate/20180920171008_change_repository_password_to_text.rb