I can not run php artisan migrate
I was able to solve my problem by changing the $schema
variable of the configureSchema ($connection, $config)
method of the /vendor/laravel/framework/src/Illuminate/Database/Connectors/PostgresConnector.php
class to the schema I created.
Before
/** * Set the schema on the connection. * * @param \PDO $connection * @param array $config * @return void */protected function configureSchema($connection, $config){ if (isset($config['schema'])) { $schema = $this->formatSchema($config['schema']); $connection->prepare("set search_path to {$schema}")->execute(); }}
After
/** * Set the schema on the connection. * * @param \PDO $connection * @param array $config * @return void */protected function configureSchema($connection, $config){ if (isset($config['schema'])) { // $schema = $this->formatSchema($config['schema']); $schema = 'controle_interno'; $connection->prepare("set search_path to {$schema}")->execute(); }}
I realized the problem debugging the stacktrace and realized that for some reason the $schema
variable was coming empty.
If someone succinctly explains why this error is happening, I mark it as an answer.