Replies: 1 comment
-
There is definitely something wrong with search_path in Laravel 9. I have just created fresh project, the only thing I changed is connection settings and 'search_path' => 'test-db', instead of public and I'm getting error php artisan migrate
Illuminate\Database\QueryException
SQLSTATE[3F000]: Invalid schema name: 7 ERROR: no schema has been selected to create in at character 14 (SQL: create table "migrations" ("id" serial primary key not null, "migration" varchar(255) not null, "batch" integer not null))
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
708▕ // If an exception occurs when attempting to run a query, we'll format the error
709▕ // message to include the bindings with SQL, which will make this exception a
710▕ // lot more helpful to the developer instead of just the database's errors.
711▕ catch (Exception $e) {
➜ 712▕ throw new QueryException(
713▕ $query, $this->prepareBindings($bindings), $e
714▕ );
715▕ }
716▕ }
+37 vendor frames
38 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) It only works when search_path is default public. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. I have recently created a new project still on LV8 which I would now like to move to LV9. I have created a new project, I have transferred all the data (taking into account differences in configurations and system files). I am using Postgresql. In the configuration I replaced schema by search_path of course. And I can not get this code to work, there is a constant error when selecting data (in the authorization stage). SELECT ... FROM users query cannot be executed. Also, telescope cannot connect even though the tables exist. Postgres has a dedicated schema for the project. SELECT VERSION() shows that I'm connected but when executing
dd(DB::getPdo()->query('select current_schemas(true)')->fetchAll());
I get:For me it looks like search_path is not applied.
Beta Was this translation helpful? Give feedback.
All reactions