We started with ID as int(11). Then we switched to Hibernate column auto generation and the ID became bigint(20). So, many foreign keys stopped working unless I change the join column definition from bigint(20) to int (11). Is it possible to write a script that changes all int(11) to bigint (20) for all columns?
The query to find all columns to change is as follows:
select table_name, column_name, column_type
from information_schema.columns
where table_schema = 'rentoptimum'
and column_type='int(11)'
order by table_name, ordinal_position;
Can I update data in the information_schema.columns or I should write the alter script for every table?