Sha256: 05c0343cc34d36bf78b6113be8bd5337d1f4778f79a93e54ffe8ef6650a529c4

Contents?: true

Size: 257 Bytes

Versions: 69

Compression:

Stored size: 257 Bytes

Contents

class AddStoreIdToOrders < ActiveRecord::Migration
  def change
    add_column :spree_orders, :store_id, :integer
    if Spree::Store.default.persisted?
      Spree::Order.where(store_id: nil).update_all(store_id: Spree::Store.default.id)
    end
  end
end

Version data entries

69 entries across 69 versions & 2 rubygems

Version Path
spree_core-2.4.4 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.0.0.rc1 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-2.4.3 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-2.4.2 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-2.4.1 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-2.4.0 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-2.4.0.rc3 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-2.4.0.rc2 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-2.4.0.rc1 db/migrate/20141009204607_add_store_id_to_orders.rb