Sha256: 3fcaae630ddc441b0d3452d74eb8d57c7b6cf3b352d1f4407fefb3dd031ddd04

Contents?: true

Size: 420 Bytes

Versions: 7

Compression:

Stored size: 420 Bytes

Contents

# This migration comes from spree (originally 20091214183826)
class PopulateLegacyShipmentState < ActiveRecord::Migration
  def up
    shipments = select_all "SELECT * FROM shipments"
    shipments.each do |shipment|
      if shipment['shipped_at']
        execute "UPDATE shipments SET state = 'shipped'"
      else
        execute "UPDATE shipments SET state = 'pending'"
      end
    end
  end

  def down
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
spree_mercado_pago_payment_method-0.0.2 spec/dummy/db/migrate/20121121030157_populate_legacy_shipment_state.spree.rb
spree_mercado_pago_payment_method-0.1.1 spec/dummy/db/migrate/20121121030157_populate_legacy_shipment_state.spree.rb
spree_mercado_pago_payment_method-0.1.0 spec/dummy/db/migrate/20121121030157_populate_legacy_shipment_state.spree.rb
datashift_spree-0.3.0 spec/sandbox/db/migrate/20121023154376_populate_legacy_shipment_state.spree.rb
datashift_spree-0.2.1 spec/sandbox/db/migrate/20121015151169_populate_legacy_shipment_state.spree.rb
datashift_spree-0.2.0 spec/sandbox/db/migrate/20120925192737_populate_legacy_shipment_state.spree.rb
datashift_spree-0.1.0 spec/sandbox/db/migrate/20120918081468_populate_legacy_shipment_state.spree.rb