lib/arcopy/copy.rb
def reset_mysql_ai
      @reset_tables.each do |table|
        max_id = TargetDB.connection "SELECT max(id) AS max_id FROM #{table}"
        max_id = max_id.first[0] + 1
        TargetDB.connection.execute "ALTER TABLE #{table} AUTO_INCREMENT = #{max_id}"
        puts "  -> resetting #{table} " + "\u{2713}".colorize(:green)
      end
    end
# Reset auto increment for mysql databases
Reset auto increment for mysql databases
Reset auto increment for mysql databases
def reset_mysql_ai
      @reset_tables.each do |table|
        max_id = TargetDB.connection "SELECT max(id) AS max_id FROM #{table}"
        max_id = max_id.first[0] + 1
        TargetDB.connection.execute "ALTER TABLE #{table} AUTO_INCREMENT = #{max_id}"
        puts "  -> resetting #{table} " + "\u{2713}".colorize(:green)
      end
    end
def reset_mysql_ai @reset_tables . each do | table | max_id = TargetDB . connection "SELECT max(id) AS max_id FROM #{table}" max_id = max_id . first [ 0 ] + 1 TargetDB . connection . execute "ALTER TABLE #{table} AUTO_INCREMENT = #{max_id}" puts "  -> resetting #{table} " + "\u{2713}" . colorize ( :green ) end end
Reset auto increment for mysql databases
Reset auto increment for mysql databases