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-3.1.0.rc3 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.1.0.rc2 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.1.0.rc1 db/migrate/20141009204607_add_store_id_to_orders.rb
solidus_core-1.0.6 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.0.8 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.0.7 db/migrate/20141009204607_add_store_id_to_orders.rb
solidus_core-1.1.3 db/migrate/20141009204607_add_store_id_to_orders.rb
solidus_core-1.0.5 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.0.6.1 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.0.6 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.0.5 db/migrate/20141009204607_add_store_id_to_orders.rb
solidus_core-1.0.4 db/migrate/20141009204607_add_store_id_to_orders.rb
solidus_core-1.1.2 db/migrate/20141009204607_add_store_id_to_orders.rb
solidus_core-1.0.3 db/migrate/20141009204607_add_store_id_to_orders.rb
solidus_core-1.1.1 db/migrate/20141009204607_add_store_id_to_orders.rb
solidus_core-1.1.0 db/migrate/20141009204607_add_store_id_to_orders.rb
solidus_core-1.1.0.pre2 db/migrate/20141009204607_add_store_id_to_orders.rb
solidus_core-1.1.0.pre1 db/migrate/20141009204607_add_store_id_to_orders.rb
solidus_core-1.1.0.beta1 db/migrate/20141009204607_add_store_id_to_orders.rb
solidus_core-1.0.2 db/migrate/20141009204607_add_store_id_to_orders.rb