Skip to content
Advertisement

Can’t do PHP Artisan Migrate with SQLSTATE [42000]

I just want to PHP Artisan Migrate, I’ve just completed my table on migration but have error

JavaScript

I’ve checked my completion that there is no error or any miss spelling

JavaScript

I’ve not added nullable because all column have to fill I’m using Laravel 8.6 and on Windows with XAMPP and MariaDB

Advertisement

Answer

The foreignId method creates an UNSIGNED BIGINT equivalent column, so there is no need to use unsignedBigInteger. Just replace it.

JavaScript

EDIT: If your table name does not match Laravel’s conventions, you may specify the table name by passing it as an argument to the constrained method:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement