I run php artisan migrate the first time, and it work perfectly fine.
I've added 1 more migration script to alter one of my table.
As soon as I ran php artisan migrate, I started to see this error.

I have this setting in my database.php
'default' => env('DB_CONNECTION', 'pgsql'),
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST'),
'database' => env('DB_DATABASE'),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
Please kindly let me know what else, I can provide.
It is an old question but i faced this problem recently and it seems after copying my migration table from another database owner is changed.
So check your database and table owners and make sure tables owned by same user.
The actual solution is to append 'schema' => 'public', to the end of the psql DB_CONNECTION.
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST'),
'database' => env('DB_DATABASE'),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
'schema' => 'public', <------- ADD HERE
],
Now, php artisan migrate works perfectly fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With