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.14 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.1.13 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.1.12 db/migrate/20141009204607_add_store_id_to_orders.rb
solidus_core-1.1.4 db/migrate/20141009204607_add_store_id_to_orders.rb
solidus_core-1.0.7 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.1.11 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.1.10 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.1.9 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.1.8 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.1.7 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.1.6 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.1.5 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.1.4 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.1.3 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.1.2 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.0.10 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.1.1 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.1.0 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.1.0.rc4 db/migrate/20141009204607_add_store_id_to_orders.rb
spree_core-3.0.9 db/migrate/20141009204607_add_store_id_to_orders.rb