summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-10-11 10:12:07 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-10-11 10:12:07 +0000
commit0b3e3471b0f6df18eb6d4e2dbe0458a40390e1ec (patch)
treefe341232259937751d55a74716bd2f023c7a9bd6 /lib
parent0ac07afc67000f38712ee5d62ffd055daa2bdc46 (diff)
downloadredmine-0b3e3471b0f6df18eb6d4e2dbe0458a40390e1ec.tar.gz
redmine-0b3e3471b0f6df18eb6d4e2dbe0458a40390e1ec.zip
Makes migration scripts load tickets in batches (#4011).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2923 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/migrate_from_mantis.rake2
-rw-r--r--lib/tasks/migrate_from_trac.rake2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/tasks/migrate_from_mantis.rake b/lib/tasks/migrate_from_mantis.rake
index d27ef77d3..a7582a38a 100644
--- a/lib/tasks/migrate_from_mantis.rake
+++ b/lib/tasks/migrate_from_mantis.rake
@@ -314,7 +314,7 @@ task :migrate_from_mantis => :environment do
Issue.destroy_all
issues_map = {}
keep_bug_ids = (Issue.count == 0)
- MantisBug.find(:all, :order => 'id ASC').each do |bug|
+ MantisBug.find_each(:batch_size => 200) do |bug|
next unless projects_map[bug.project_id] && users_map[bug.reporter_id]
i = Issue.new :project_id => projects_map[bug.project_id],
:subject => encode(bug.summary),
diff --git a/lib/tasks/migrate_from_trac.rake b/lib/tasks/migrate_from_trac.rake
index 8640c9357..1902af8d0 100644
--- a/lib/tasks/migrate_from_trac.rake
+++ b/lib/tasks/migrate_from_trac.rake
@@ -458,7 +458,7 @@ namespace :redmine do
# Tickets
print "Migrating tickets"
- TracTicket.find(:all, :order => 'id ASC').each do |ticket|
+ TracTicket.find_each(:batch_size => 200) do |ticket|
print '.'
STDOUT.flush
i = Issue.new :project => @target_project,