Sha256: bd12a21b515523c07734ace0126f9aa5552d9091edcb5077c56bda36805991fd

Contents?: true

Size: 650 Bytes

Versions: 179

Compression:

Stored size: 650 Bytes

Contents

class AddDockerRepoName < ActiveRecord::Migration[4.2]
  class FakeRepository < ApplicationRecord
    self.table_name = 'katello_repositories'
    scope :docker_type, -> { where(:content_type => 'docker') }

    def set_container_repository_name
      self.container_repository_name = Katello::Repository.safe_render_container_name(self)
    end
  end

  def up
    add_column :katello_repositories, :container_repository_name, :string

    FakeRepository.docker_type.find_each do |repo|
      repo.set_container_repository_name
      repo.save!
    end
  end

  def down
    remove_column :katello_repositories, :container_repository_name
  end
end

Version data entries

179 entries across 179 versions & 1 rubygems

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