[issue #590] Attempt to speed up migration.
This commit is contained in:
parent
bf251e01c0
commit
d407433f45
|
@ -2,7 +2,7 @@ class AddSaveToRepositoryToBuildLists < ActiveRecord::Migration
|
||||||
def self.up
|
def self.up
|
||||||
add_column :build_lists, :save_to_repository_id, :integer
|
add_column :build_lists, :save_to_repository_id, :integer
|
||||||
|
|
||||||
BuildList.scoped.find_in_batches do |batch|
|
BuildList.scoped.includes(:project => :repositories, :save_to_platform => :repositories).find_in_batches do |batch|
|
||||||
batch.each do |bl|
|
batch.each do |bl|
|
||||||
begin
|
begin
|
||||||
project = bl.project
|
project = bl.project
|
||||||
|
|
Loading…
Reference in New Issue