Sha256: 67e7a2a0f26df71c0529cec8d53d92104e16a841831f319cc6fbacda2fb37b00
Contents?: true
Size: 613 Bytes
Versions: 105
Compression:
Stored size: 613 Bytes
Contents
class UpdateProductsAddOrganization < ActiveRecord::Migration[4.2] class Katello::Product < ApplicationRecord belongs_to :provider self.inheritance_column = nil end def up add_column :katello_products, :organization_id, :integer, :null => true Katello::Product.all.each do |product| product.organization_id = product.provider.organization_id product.save! end change_column :katello_products, :organization_id, :integer, :null => false add_index :katello_products, :organization_id end def down remove_column :katello_products, :organization_id end end
Version data entries
105 entries across 105 versions & 1 rubygems