Friday, July 22, 2016

ERROR 1215 (HY000) at line 132: Cannot add foreign key constraint

If the data type of table column does not match to foreign key column then during schema creation MySQL throw error ERROR 1215 (HY000) at line 132: Cannot add foreign key constraint

Common mistake is that the foreign key column type is UNSIGNED integer but the column in other table is default integer.