Ad
How To Define Schema Migration Laravel Postgres?
Im using a multitenant package in Laravel called Laravel Tenancy and i change the setting to work with SCHEMA, every tenant has your schema right?
Well i'm using postgres and I'd like to change 'public' the default schema, i'd like to use maindatabase.
I have changed it in:
'connections' => [
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'schema' => 'maindatabase',
'sslmode' => 'prefer',
],
]
But when I execute php artisan migrate i have this error:
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))
How can I fix it? Thank you
Ad
Answer
Make sure you have all USAGE privilege to that schema, i.e.:
GRANT USAGE ON SCHEMA maindatabase TO your_username;
Ad
source: stackoverflow.com
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS - Conditionally Load a Different Page
- → Make a Laravel collection into angular array (octobercms)
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
- → Validating fileupload(image Dimensions) in Backend Octobercms
- → OctoberCMS Fileupload completely destroys my backend
- → How do I call the value from another backed page form and use it on a component in OctoberCms
Ad