SERIAL data type and "mysql 1215 - Cannot add foreign key constraint." Check UNSIGNED

Just a helpful tip I hope.

I did not know about exact matching data types so dutifully turned the fk into a BIGINT.

Still did not work and then lost ages before I noticed that SERIAL specifies UNSIGNED BIGINT. Changed FK to UNSIGNED and voila.

This I am sure is a nube mistake but it was impossible to find on many Google searches.

If anyone can think of useful search terms for this pls let me know or add.

Don’t need any advice just sure I am not the first one caught out like this so thought I would give an answer instead of a question for a change :slight_smile: