Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/Console/Commands/Environment/DatabaseSettingsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class DatabaseSettingsCommand extends Command
protected $signature = 'p:environment:database
{--driver= : The database driver backend to use.}
{--database= : The database to use.}
{--schema= : The schema to use for the PostgreSQL database.}
{--host= : The connection address for the MySQL/ MariaDB/ PostgreSQL server.}
{--port= : The connection port for the MySQL/ MariaDB/ PostgreSQL server.}
{--username= : Username to use when connecting to the MySQL/ MariaDB/ PostgreSQL server.}
Expand Down Expand Up @@ -196,6 +197,11 @@ public function handle(): int
config('database.connections.pgsql.database', 'panel')
);

$this->variables['DB_SCHEMA'] = $this->option('schema') ?? $this->ask(
'Database Schema',
config('database.connections.pgsql.search_path', 'public')
);

$this->output->note(trans('commands.database_settings.DB_USERNAME_note'));
$this->variables['DB_USERNAME'] = $this->option('username') ?? $this->ask(
'Database Username',
Expand Down Expand Up @@ -224,7 +230,7 @@ public function handle(): int
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'search_path' => 'public',
'search_path' => $this->variables['DB_SCHEMA'],
'sslmode' => 'prefer',
]);

Expand Down
2 changes: 1 addition & 1 deletion config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => '',
'prefix_indexes' => true,
'search_path' => 'public',
'search_path' => env('DB_SCHEMA', 'public'),
Comment thread
coderabbitai[bot] marked this conversation as resolved.
'sslmode' => 'prefer',
],

Expand Down
Loading