The database looks at all the foreign keys to verify whether a foreign key already exists (mysql).
Find duplicate foreign key names, where used, SQL as follows:
select * from INFORMATION_SCHEMA.KEY_COLUMN_USAGE where CONSTRAINT_NAME='NAME'
If no problem, rename it
Thank you