-
-
Notifications
You must be signed in to change notification settings - Fork 554
Closed
Description
The command database:add
does not allow to create the first database defined by $databases['default']['default']
. This can be useful in case a fresh install that you want to connect to an existing database. Currently the command only allows adding database in addition to the default one.
I suggest adding an option like --default
to add the default database. The current template add.php.twig
is:
$databases['{{ database }}']['default'] = [
'database' => '{{ database }}',
'username' => '{{ username }}',
'password' => '{{ password }}',
'host' => '{{ host }}',
'port' => '{{ port }}',
'driver' => '{{ driver }}',
'prefix' => '{{ prefix }}',
];
I suggest adding add-default.php.twig
:
$databases['default']['default'] = [
'database' => '{{ database }}',
'username' => '{{ username }}',
'password' => '{{ password }}',
'host' => '{{ host }}',
'port' => '{{ port }}',
'driver' => '{{ driver }}',
'prefix' => '{{ prefix }}',
];
This new template would be called instead, when using --default
option.
What do you think? I'd be pleased to do a pull request.
Metadata
Metadata
Assignees
Labels
No labels