[mysql] MySQL Error 1215: Cannot add foreign key constraint

I had the same problem.
I solved it doing this:

I created the following line in the
primary key: (id int(11) unsigned NOT NULL AUTO_INCREMENT)

I found out this solution after trying to import a table in my schema builder. If it works for you, let me know!

Good luck!

Felipe Tércio