Sha256: 6a7631cd7b5da3b3e68da08c464ab8ab328e04607e43c4a8b0f1dac4e783d38f

Contents?: true

Size: 267 Bytes

Versions: 39

Compression:

Stored size: 267 Bytes

Contents

class AddOrderIdsToAdjustmentsWhereMissing < ActiveRecord::Migration
  def up
    Spree::Adjustment.where(order_id: nil, adjustable_type: 'Spree::Order').update_all("order_id = adjustable_id")
  end

  def down
    raise ActiveRecord::IrreversibleMigration
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
solidus_core-1.4.2 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.3.2 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.2.3 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.1.4 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.0.7 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.4.1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.4.0 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.4.0.rc1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.4.0.beta1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.3.1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.3.0 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.3.0.rc2 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.3.0.rc1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.3.0.beta1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.0.6 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.2.2 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.2.1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.1.3 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.0.5 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-1.2.0 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb