Sha256: 2d959075526f9197629ba3b0b619408a7563cc4ddd84a4b4bd6a9532997c3ef0

Contents?: true

Size: 533 Bytes

Versions: 137

Compression:

Stored size: 533 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.reset_column_information
    ::Katello::Pool.find_each do |pool|
      pool.update(:organization_id => pool.subscription.organization_id) if pool.subscription
    end
  end

  def down
    remove_column :katello_pools, :organization_id
  end
end

Version data entries

137 entries across 137 versions & 1 rubygems

Version Path
katello-3.17.0.rc2.1 db/migrate/20180410140909_add_organization_id_to_pool.rb
katello-3.16.1.2 db/migrate/20180410140909_add_organization_id_to_pool.rb
katello-3.16.1.1 db/migrate/20180410140909_add_organization_id_to_pool.rb
katello-3.17.0.rc2 db/migrate/20180410140909_add_organization_id_to_pool.rb
katello-3.16.1 db/migrate/20180410140909_add_organization_id_to_pool.rb
katello-3.17.0.rc1 db/migrate/20180410140909_add_organization_id_to_pool.rb
katello-3.16.0 db/migrate/20180410140909_add_organization_id_to_pool.rb
katello-3.16.0.rc5.1 db/migrate/20180410140909_add_organization_id_to_pool.rb
katello-3.16.0.rc5 db/migrate/20180410140909_add_organization_id_to_pool.rb
katello-3.16.0.rc4.1 db/migrate/20180410140909_add_organization_id_to_pool.rb
katello-3.16.0.rc4 db/migrate/20180410140909_add_organization_id_to_pool.rb
katello-3.16.0.rc3.1 db/migrate/20180410140909_add_organization_id_to_pool.rb
katello-3.16.0.rc3 db/migrate/20180410140909_add_organization_id_to_pool.rb
katello-3.16.0.rc2.1 db/migrate/20180410140909_add_organization_id_to_pool.rb
katello-3.16.0.rc2 db/migrate/20180410140909_add_organization_id_to_pool.rb
katello-3.16.0.rc1.1 db/migrate/20180410140909_add_organization_id_to_pool.rb
katello-3.16.0.rc1 db/migrate/20180410140909_add_organization_id_to_pool.rb