Sha256: db7de0c17416c4913e07d44c95ed451524e73daefc846f3e1e8136dc9c4fd06a

Contents?: true

Size: 535 Bytes

Versions: 35

Compression:

Stored size: 535 Bytes

Contents

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

35 entries across 35 versions & 3 rubygems

Version Path
spree_core-1.2.5 db/migrate/20100419194457_fix_existing_coupon_credits.rb
spree_core-1.1.6 db/migrate/20100419194457_fix_existing_coupon_credits.rb
spree_core-1.1.5 db/migrate/20100419194457_fix_existing_coupon_credits.rb
spree_core-1.2.4 db/migrate/20100419194457_fix_existing_coupon_credits.rb
spree_core-1.0.7 db/migrate/20100419194457_fix_existing_coupon_credits.rb
spree_core-1.2.3 db/migrate/20100419194457_fix_existing_coupon_credits.rb
spree_core-1.2.2 db/migrate/20100419194457_fix_existing_coupon_credits.rb
spree_core-1.1.4 db/migrate/20100419194457_fix_existing_coupon_credits.rb
spree_core-1.2.0 db/migrate/20100419194457_fix_existing_coupon_credits.rb
spree_core-1.2.0.rc2 db/migrate/20100419194457_fix_existing_coupon_credits.rb
spree_core-1.2.0.rc1 db/migrate/20100419194457_fix_existing_coupon_credits.rb
spree_core-1.1.3 db/migrate/20100419194457_fix_existing_coupon_credits.rb
spree_core-1.0.6 db/migrate/20100419194457_fix_existing_coupon_credits.rb
spree_pag_seguro-1.0.7 spec/dummy/db/migrate/20120301154089_fix_existing_coupon_credits.rb
spree_core-1.1.2 db/migrate/20100419194457_fix_existing_coupon_credits.rb
spree_core-1.1.2.rc1 db/migrate/20100419194457_fix_existing_coupon_credits.rb
spree_pag_seguro-1.0.6 spec/dummy/db/migrate/20120301154089_fix_existing_coupon_credits.rb
spree_pag_seguro-1.0.5 spec/dummy/db/migrate/20120301154089_fix_existing_coupon_credits.rb
spree_pag_seguro-1.0.4 spec/dummy/db/migrate/20120301154089_fix_existing_coupon_credits.rb
spree_core-1.1.1 db/migrate/20100419194457_fix_existing_coupon_credits.rb