migrate_from_trac.mysql2.patch

fix mysql2 query - Bernhard Wenzel, 2014-01-07 18:51

Download (1.07 KB)

View differences:

migrate_from_trac.mysql2.rb 2014-01-07 18:38:38.441120973 +0100
626 626

  
627 627
      def self.set_trac_adapter(adapter)
628 628
        return false if adapter.blank?
629
        raise "Unknown adapter: #{adapter}!" unless %w(sqlite3 mysql postgresql).include?(adapter)
629
        raise "Unknown adapter: #{adapter}!" unless %w(sqlite3 mysql2 postgresql).include?(adapter)
630 630
        # If adapter is sqlite or sqlite3, make sure that trac.db exists
631 631
        raise "#{trac_db_path} doesn't exist!" if %w(sqlite3).include?(adapter) && !File.exist?(trac_db_path)
632 632
        @@trac_adapter = adapter
......
750 750
      end
751 751
    end
752 752

  
753
    DEFAULT_PORTS = {'mysql' => 3306, 'postgresql' => 5432}
753
    DEFAULT_PORTS = {'mysql2' => 3306, 'postgresql' => 5432}
754 754

  
755 755
    prompt('Trac directory') {|directory| TracMigrate.set_trac_directory directory.strip}
756 756
    prompt('Trac database adapter (sqlite3, mysql2, postgresql)', :default => 'sqlite3') {|adapter| TracMigrate.set_trac_adapter adapter}