In my general_exams
table, I have a column named semester
, type is string
. Now I want to change its name to semester_id
, type
This error is because there is existing data in the tables (or default values, perhaps ..) that PG doesn't know how to convert from string to integer. Either get rid of the data or tell PG how you want to convert it, using PG specific SQL (I think you'll want USING
) and execute
migration command. See Rails guides on migrations.