mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 14:45:56 +08:00
Improve speed of step orderable elements migration [SCI-7092]
This commit is contained in:
parent
92adc43d42
commit
f5178fdd92
|
@ -5,7 +5,7 @@ class GenerateStepOrderableRelation < ActiveRecord::Migration[6.1]
|
|||
include DatabaseHelper
|
||||
|
||||
def up
|
||||
Step.find_in_batches(batch_size: 100) do |steps|
|
||||
Step.preload(:step_texts, :step_tables, :checklists).find_in_batches(batch_size: 100) do |steps|
|
||||
steps.each do |step|
|
||||
position = 0
|
||||
orderable_elements = []
|
||||
|
|
Loading…
Reference in a new issue