Change supplier_id of stock orders to NULL
This commit is contained in:
parent
aa44291b69
commit
5f60844a13
4 changed files with 16 additions and 5 deletions
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue