Sha256: 2d959075526f9197629ba3b0b619408a7563cc4ddd84a4b4bd6a9532997c3ef0

Contents?: true

Size: 533 Bytes

Versions: 134

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

134 entries across 134 versions & 1 rubygems

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