diff --git a/src/onedb/local/4.90.0_to_5.3.80.rb b/src/onedb/local/4.90.0_to_5.3.80.rb index 87a58cb4ca..d8b17bf55f 100644 --- a/src/onedb/local/4.90.0_to_5.3.80.rb +++ b/src/onedb/local/4.90.0_to_5.3.80.rb @@ -101,7 +101,7 @@ module Migrator ############################################################################ def feature_5005 @db.run "ALTER TABLE vm_pool RENAME TO old_vm_pool;" - @db.run host_pool_schema() + @db.run vm_pool_schema() @db.transaction do @db.fetch("SELECT * FROM old_vm_pool") do |row| @@ -110,7 +110,7 @@ module Migrator c.default_xml.noblanks } - doc.root.xpath(HISTORY_RECORDS/HISTORY).each do |h| + doc.root.xpath("HISTORY_RECORDS/HISTORY").each do |h| reason = h.xpath("REASON") reason.unlink if !reason.nil? @@ -127,8 +127,8 @@ module Migrator @db[:vm_pool].insert(row) end + end - end @db.run "DROP TABLE old_vm_pool;" end end diff --git a/src/onedb/onedb.rb b/src/onedb/onedb.rb index 05374d8a75..989deee383 100644 --- a/src/onedb/onedb.rb +++ b/src/onedb/onedb.rb @@ -35,10 +35,10 @@ class OneDB @backend = BackEndSQLite.new(ops[:sqlite]) elsif ops[:backend] == :mysql begin - require 'mysql' + require 'mysql2' rescue LoadError - STDERR.puts "Ruby gem mysql is needed for this operation:" - STDERR.puts " $ sudo gem install mysql" + STDERR.puts "Ruby gem mysql2 is needed for this operation:" + STDERR.puts " $ sudo gem install mysql2" exit -1 end diff --git a/src/onedb/onedb_backend.rb b/src/onedb/onedb_backend.rb index d05d2292fb..d30f1cbacb 100644 --- a/src/onedb/onedb_backend.rb +++ b/src/onedb/onedb_backend.rb @@ -272,7 +272,7 @@ class BackEndMySQL < OneDBBacKEnd def connect_db passwd = CGI.escape(@passwd) - endpoint = "mysql://#{@user}:#{passwd}@#{@server}:#{@port}/#{@db_name}" + endpoint = "mysql2://#{@user}:#{passwd}@#{@server}:#{@port}/#{@db_name}" begin @db = Sequel.connect(endpoint)