Sha256: 3b34d07bacc1b4943e6abc7a6effdb131bd8dbe01bc01cac36f9778a6f401b52

Contents?: true

Size: 497 Bytes

Versions: 1

Compression:

Stored size: 497 Bytes

Contents

class AddOrganizationIdToPool < ActiveRecord::Migration[5.1]
  def up
    add_column :katello_pools, :organization_id, :integer
    add_foreign_key 'katello_pools', 'taxonomies',
                :name => 'katello_pools_organization_id', :column => 'organization_id'

    Katello::Pool.find_each do |pool|
      pool.update_attributes(:organization_id => pool.subscription.organization_id) if pool.subscription
    end
  end

  def down
    remove_column :katello_pools, :organization_id
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
katello-3.7.0.rc1 db/migrate/20180410140909_add_organization_id_to_pool.rb