viewings.ip column too short for IPv6 addresses

Details about the problem:

viewings.ip column too short for IPv6 addresses
ActiveRecord::ValueTooLong (Mysql2::Error: Data too long for column 'ip' at
row 1)
Started GET "/issues/190630" 
Processing by IssuesController#show as HTML
Completed 500 Internal Server Error in 19ms

Solution of the problem:

-- MySQL:
ALTER TABLE viewings MODIFY ip VARCHAR(45);

-- PostgreSQL:
ALTER TABLE viewings ALTER COLUMN ip TYPE VARCHAR(45);
Was this article helpful? Yes  No
79 from 79 found this helpful