-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Closed
Labels
Description
- Laravel Version: 9.0.x
- PHP Version: not related with php version
- Database Driver & Version: not related with driver
Description:
| $this->connection->getConfig('search_path') ?: 'public' |
I suppose that this one line should be like in other places of the same file:
$this->connection->getConfig('search_path') ?: $this->connection->getConfig('schema')
Otherwise, if you check table exists at postgres schema from env variable DB_SCHEMA referenced in the config, but it checks default postgres schema "public", ignoring the configuration.
Steps To Reproduce:
- Create table "migrations" at default postgres schema public
- Set env variable DB_SCHEMA with value different from "public" that do not contain any tables (the schema should exist at the DB, of course)
- Run command
php artisan migrate.
You'll see that it will fail with error that it can't reference "migrations" table that not exist.
If you turn on SQL queries log, you'll see that it have checked table "migrations" in schema "public", found it exists and try to make a query to that table in schema you referenced at the env variable DB_SCHEMA that still does not exist.