2020-08-07 01:14:14 +02:00
|
|
|
class ClearInvalidInvoicesFromOrders < ActiveRecord::Migration[4.2]
|
2020-06-22 17:03:58 +02:00
|
|
|
class Order < ActiveRecord::Base; end
|
2021-03-01 15:27:26 +01:00
|
|
|
|
2020-06-22 17:03:58 +02:00
|
|
|
class Invoice < ActiveRecord::Base; end
|
|
|
|
|
|
|
|
def up
|
|
|
|
Order.where.not(invoice_id: Invoice.all).update_all(invoice_id: nil)
|
|
|
|
end
|
|
|
|
end
|