Nullify deliveries and orders depending on an invoice (#718)
This commit is contained in:
parent
5eb8abf431
commit
fc22a97f52
2 changed files with 10 additions and 2 deletions
|
|
@ -0,0 +1,8 @@
|
|||
class ClearInvalidInvoicesFromOrders < ActiveRecord::Migration
|
||||
class Order < ActiveRecord::Base; end
|
||||
class Invoice < ActiveRecord::Base; end
|
||||
|
||||
def up
|
||||
Order.where.not(invoice_id: Invoice.all).update_all(invoice_id: nil)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue