What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-10-12 12:20:07
errno: 150 foreign key constraint is incorrectly formed laravel 8
Since increments() creates an unsigned integer column, you need to define the foreign key column as unsigned integer too. Default migrations in Laravel 6+ use bigIncrements(), so you need to use unsignedBigInteger() method: $table->unsignedBigInteger... Add solution