mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-05 07:19:14 +00:00
7 lines
272 B
Ruby
7 lines
272 B
Ruby
class ResetNegativeStockLevels < ActiveRecord::Migration[4.2]
|
|
def up
|
|
# Reset stock to zero for all on_demand variants that have negative stock
|
|
execute "UPDATE spree_stock_items SET count_on_hand = '0' WHERE count_on_hand < 0 AND backorderable IS TRUE"
|
|
end
|
|
end
|