mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-20 11:52:37 +09:00
Feature #4305: Accelerate database conversion to ludicrous speed
(cherry picked from commit 14a9ec048e)
This commit is contained in:
1 parent
c489e193dd
commit
8a05b49d59
1 file changed
+12
-11
+12
-11
@@ -11,21 +11,22 @@ module Sqlite2MySQL
|
||||
records = sqlite_db[table].count
|
||||
puts "> #{table} (#{records} records)"
|
||||
|
||||
i=0
|
||||
sqlite_db[table].each do |row|
|
||||
@db[table].insert(row)
|
||||
@db.transaction do
|
||||
i=0
|
||||
sqlite_db[table].each do |row|
|
||||
@db[table].insert(row)
|
||||
|
||||
i+=1
|
||||
if i % PROGRESS == 0
|
||||
if i < PROGRESS+1
|
||||
print " #{i}"
|
||||
else
|
||||
print "...#{i}"
|
||||
i+=1
|
||||
if i % PROGRESS == 0
|
||||
if i < PROGRESS+1
|
||||
print " #{i}"
|
||||
else
|
||||
print "...#{i}"
|
||||
end
|
||||
end
|
||||
end
|
||||
puts if i > PROGRESS-1
|
||||
end
|
||||
|
||||
puts if i > PROGRESS-1
|
||||
end
|
||||
|
||||
puts "\nMigration successful."
|
||||
|
||||
Reference in new issue
Block a user