Sha256: eedd3d45d4d31f3178014d3593e16cd9bfd8137e0c3ab159b9ccbfe65156520f
Contents?: true
Size: 735 Bytes
Versions: 21
Compression:
Stored size: 735 Bytes
Contents
class ChangeReturnItemPreTaxAmountToAmount < ActiveRecord::Migration[4.2] def up execute(<<-SQL) UPDATE spree_return_items SET included_tax_total = 0 WHERE included_tax_total IS NULL SQL execute(<<-SQL) UPDATE spree_return_items SET pre_tax_amount = pre_tax_amount + included_tax_total SQL rename_column :spree_return_items, :pre_tax_amount, :amount end def down execute(<<-SQL) UPDATE spree_return_items SET included_tax_total = 0 WHERE included_tax_total IS NULL SQL execute(<<-SQL) UPDATE spree_return_items SET amount = amount - included_tax_total SQL rename_column :spree_return_items, :amount, :pre_tax_amount end end
Version data entries
21 entries across 21 versions & 1 rubygems