Change supplier_id of stock orders to NULL

This commit is contained in:
Patrick Gansterer 2020-08-13 16:23:01 +02:00
parent aa44291b69
commit 5f60844a13
4 changed files with 16 additions and 5 deletions

View file

@ -0,0 +1,11 @@
class ChangeStockSupplierToNullInOrder < ActiveRecord::Migration
class Order < ActiveRecord::Base; end
def up
Order.where(supplier_id: 0).update_all(supplier_id: nil)
end
def down
Order.where(supplier_id: nil).update_all(supplier_id: 0)
end
end