Sha256: 5727bf535476143eedd7588514da9d38b1c49c7d56d20e1c4648eca05567fb67

Contents?: true

Size: 529 Bytes

Versions: 10

Compression:

Stored size: 529 Bytes

Contents

class AddUpstreamNameToRepository < ActiveRecord::Migration
  def up
    add_column :katello_repositories, :docker_upstream_name, :string
    Katello::Repository.docker_type.each do |repo|
      next if repo.url.blank?
      update %(
        update #{Katello::Repository.table_name}
              set docker_upstream_name=#{ActiveRecord::Base.sanitize(repo.name)}
              where id=#{repo.id}
      ).gsub(/\s+/, " ").strip
    end
  end

  def down
    remove_column :katello_repositories, :docker_upstream_name
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
katello-2.4.5 db/migrate/20150114225023_add_upstream_name_to_repository.rb
katello-2.4.4 db/migrate/20150114225023_add_upstream_name_to_repository.rb
katello-2.4.3 db/migrate/20150114225023_add_upstream_name_to_repository.rb
katello-2.4.2 db/migrate/20150114225023_add_upstream_name_to_repository.rb
katello-2.4.1 db/migrate/20150114225023_add_upstream_name_to_repository.rb
katello-2.4.0 db/migrate/20150114225023_add_upstream_name_to_repository.rb
katello-2.4.0.rc3 db/migrate/20150114225023_add_upstream_name_to_repository.rb
katello-2.4.0.rc2 db/migrate/20150114225023_add_upstream_name_to_repository.rb
katello-2.4.0.rc1 db/migrate/20150114225023_add_upstream_name_to_repository.rb
katello-2.2.2 db/migrate/20150114225023_add_upstream_name_to_repository.rb