MySQL index name and foreign key name must be different for different tables?
For example,
Two tables both have the same field(profile_id) which are belonging to a third table(profiles). So I want to make the profile_id indexed and constrain it as a foreign key.
Could the index name be named "profile_id_idx" in both tables?
And "profile_id_fk" as name of foreign key for both too?
解决方案
Foreign Key names must be unique across all tables in all databases. Index names may be re-used in different tables.