Sha256: 4d76fc32d2d7c41903568d0327b8d3d633b7901e3f3ad619e684420aecbb7367

Contents?: true

Size: 272 Bytes

Versions: 21

Compression:

Stored size: 272 Bytes

Contents

class AddOrderIdsToAdjustmentsWhereMissing < ActiveRecord::Migration[4.2]
  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

21 entries across 21 versions & 1 rubygems

Version Path
solidus_core-2.3.1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.2.2 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.1.1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.0.3 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.3.0 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.3.0.rc3 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.3.0.rc2 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.3.0.rc1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.3.0.beta1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.0.2 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.2.1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.2.0 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.2.0.rc1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.2.0.beta1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.1.0 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.1.0.rc1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.0.1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.1.0.beta1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.0.0 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb
solidus_core-2.0.0.rc1 db/migrate/20150227161934_add_order_ids_to_adjustments_where_missing.rb