Sha256: 451ce0c5bb4db2aa4c543ed05a5b867559ee71d1a765efa33dc67bbd05af5175

Contents?: true

Size: 597 Bytes

Versions: 7

Compression:

Stored size: 597 Bytes

Contents

# This migration comes from spree (originally 20100419194457)
class Adjustment < ActiveRecord::Base; end;

class FixExistingCouponCredits < ActiveRecord::Migration
  def up
    execute("UPDATE adjustments SET type='PromotionCredit' WHERE type='CouponCredit'")
    execute("UPDATE adjustments SET adjustment_source_type='Promotion' WHERE adjustment_source_type='Coupon'")
  end

  def down
    execute("UPDATE adjustments SET adjustment_source_type='Coupon' WHERE adjustment_source_type='Promotion'")
    execute("UPDATE adjustments SET type='CouponCredit' WHERE type='PromotionCredit'")
  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/20121121030176_fix_existing_coupon_credits.spree.rb
spree_mercado_pago_payment_method-0.1.1 spec/dummy/db/migrate/20121121030176_fix_existing_coupon_credits.spree.rb
spree_mercado_pago_payment_method-0.1.0 spec/dummy/db/migrate/20121121030176_fix_existing_coupon_credits.spree.rb
datashift_spree-0.3.0 spec/sandbox/db/migrate/20121023154395_fix_existing_coupon_credits.spree.rb
datashift_spree-0.2.1 spec/sandbox/db/migrate/20121015151188_fix_existing_coupon_credits.spree.rb
datashift_spree-0.2.0 spec/sandbox/db/migrate/20120925192756_fix_existing_coupon_credits.spree.rb
datashift_spree-0.1.0 spec/sandbox/db/migrate/20120918081487_fix_existing_coupon_credits.spree.rb