Hi. I’m using a migration to extract data from one table, to another. In
the process I also convert ip-adresses to integers, for insertion in the
Problem is that migrations doesn’t seem to handle large numbers very
well. The conversion works fine from the script/console, but when
running it from migrations only very low IP-ranges “make it thru”.
Integer-based IPs seem to be capped around 2150000000.
@ips = GeoIpDatabase.find(:all)
@ips.each do |ip|
start_ip = IPAddr.new(ip.start_ip)
end_ip = IPAddr.new(ip.end_ip)
new_ip = Ip.new( :start_ip => start_ip.to_s, :end_ip =>
end_ip.to_s, :start_ip_integer => start_ip.to_i, :end_ip_integer =>
I’m using MySQL, with the integer-columns migrated as, yes, integers
Anyone know of a workaround?