So I\'m trying to add Foreign Key constraints to my database as a project requirement and it worked the first time or two on different tables, but I have two tables on which
Had a similar error, but in my case I was missing to declare the pk as auto_increment.
Just in case it could be helpful to anyone