2020-08-07 01:14:14 +02:00
|
|
|
class UpdateGroupOrderTotals < ActiveRecord::Migration[4.2]
|
2013-07-02 12:01:25 +02:00
|
|
|
def self.up
|
2013-09-18 18:33:49 +02:00
|
|
|
say "If you have ever modified an order after it was settled, the group_order's " +
|
2023-05-12 13:01:12 +02:00
|
|
|
'price may be calculated incorrectly. This can take a lot of time on a ' +
|
|
|
|
'large database.'
|
2013-09-18 18:33:49 +02:00
|
|
|
|
2023-05-12 13:01:12 +02:00
|
|
|
say 'If you do want to update the ordergroup totals, open the rails console ' +
|
|
|
|
'(by running `rails c`), and enter:'
|
2013-09-18 18:33:49 +02:00
|
|
|
|
2023-05-12 13:01:12 +02:00
|
|
|
say 'GroupOrder.all.each { |go| go.order.closed? and go.update_price! }', subitem: true
|
2013-09-18 18:33:49 +02:00
|
|
|
|
2023-05-12 13:01:12 +02:00
|
|
|
say 'You may want to check first that no undesired accounting issues are introduced. ' +
|
|
|
|
'It may be wise to discuss this with those responsible for the ordering finances.'
|
2013-07-02 12:01:25 +02:00
|
|
|
end
|
|
|
|
|
2023-05-12 13:01:12 +02:00
|
|
|
def self.down; end
|
2013-07-02 12:01:25 +02:00
|
|
|
end
|