class UpdateCalculableTypeForPromotions < ActiveRecord::Migration
  def up
    Spree::Calculator.where(:calculable_type => 'Coupon').update_all(:calculable_type => 'Promotion')
  end

  def down
    Spree::Calculator.where(:calculable_type => 'Promotion').update_all(:calculable_type => 'Coupon')
  end
end

class UpdateCalculableTypeForPromotions < ActiveRecord::Migration
  def up
    execute "UPDATE spree_calculators SET calculable_type = 'Promotion' WHERE calculable_type = 'Coupon'"
  end

  def down
    execute "UPDATE spree_calculators SET calculable_type = 'Coupon' WHERE calculable_type = 'Promotion'"
  end
end

Convert UpdateCalculableTypeForPromotions migration to use SQL
[promo] Convert UpdateCalculableTypeForPromotions migration to use SQL
