change_column

Try to specify the :limit and :default for the migration and run it again.

Check for the rows that contain some string values in the column ci_class

The original error you posted

RuntimeError: ERROR C42846 Mcannot cast type character varying to

integer Fparse_expr.c L1533 Rtypecast_expression: UPDATE software_cis

SET ci_class_ar_tmp = CAST(ci_class AS integer)

strongly suggests that there are values in the ci_class column that cannot be cast as integer. Either they are spaces, characters, or something. Most databases have some sort of IS_NUMERIC function you can use to verify the contents of the columns. In the database query tool that you use, run something like

select * from software_cis where is_numeric(ci_class) = 0

You’ll have to adapt that for your specific database. I’m thinking you should have at least one row returned.

Peace,

Phillip