Sha256: 0cba0137cc8519d6adbd1a193a56f7f3e741d72846d537fc6e53dece21b0f0de

Contents?: true

Size: 948 Bytes

Versions: 164

Compression:

Stored size: 948 Bytes

Contents

class RemoveDockerImageSchema < ActiveRecord::Migration[4.2]
  def up
    if foreign_key_exists?(:katello_docker_tags, :name => "katello_docker_tags_docker_image_id_fk")
      remove_foreign_key :katello_docker_tags, :name => "katello_docker_tags_docker_image_id_fk"
    end
    remove_column :katello_docker_tags, :docker_image_id
    drop_table :katello_docker_images
  end

  def down
    add_column :katello_docker_tags, :docker_image_id, :integer

    create_table :katello_docker_images do |t|
      t.string :image_id, :limit => 255
      t.integer :size
      t.string :uuid, :limit => 255
      t.timestamps
    end

    add_index :katello_docker_images, :uuid, :unique => true

    add_index :katello_docker_tags, [:docker_image_id, :repository_id, :name],
              :name => :docker_tag_docker_image_repo_name, :unique => true

    add_foreign_key :katello_docker_tags, :katello_docker_images, :column => "docker_image_id"
  end
end

Version data entries

164 entries across 164 versions & 1 rubygems

Version Path
katello-4.3.1 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.4.0 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.4.0.rc2 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.4.0.rc1 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.2.2 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.3.0 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.3.0.rc4 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.3.0.rc3 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.3.0.rc2.1 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.3.0.rc2 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.3.0.rc1 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.2.1 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.2.0.1 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.1.4 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.0.3 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.2.0.1.rc3 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-3.18.5 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.2.0.1.rc2 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.2.0.rc2 db/migrate/20160203195736_remove_docker_image_schema.rb
katello-4.1.3 db/migrate/20160203195736_remove_docker_image_schema.rb