- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
class MoveAchieveTemplateIdentifierToRatePeriodPrograms < ActiveRecord::Migration
def up
RatePeriod.find_in_batches(batch_size: 1_000) do |batch|
sleep(50)
batch.each do |rate_period|
achieve_template_identifier = rate_period.achieve_template_identifier
rate_period.rate_period_programs.update_all(achieve_template_identifier: achieve_template_identifier)
end
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end
Desktop 22.06.2024 22:11 # 0
guest6 22.06.2024 22:12 # 0
Desktop 22.06.2024 22:14 # 0