MySQL error 1022 when creating table

The problem is that the name of a foreign key can not be the same as another foreign key in the entire model.

Imagine this situation

Catalog –> Supplier

Product –> Supplier

if the name of the foreign key in table Catalog for supplier is “supplier” and you assigned the same name in product table then the foreign keys names will “collide”.

You need to name them differently..

For example:

catalog_supplier
product_supplier

Leave a Comment