feat: allow for adding extra databases

Allow for declaring extra databases that should be created when the
project is first started. This is done by adding an `extra_databases`
key to `database`, containing a list of database names.

```yaml
database:
  type: mariadb
  version: 10
  extra_databases:
    - tinhat
    - freshcover
```
This commit is contained in:
Oliver Davies 2023-04-07 08:23:27 +01:00
parent 692151d26c
commit 4d034d9ba2
4 changed files with 29 additions and 1 deletions

View file

@ -78,6 +78,13 @@ $app->command(
['env.example', '.env.example'],
]);
$extraDatabases = Arr::get($configurationData, 'database.extra_databases', []);
if (count($extraDatabases) > 0) {
$filesystem = new Filesystem();
$filesystem->mkdir("{$outputDir}/tools/docker/images/database/root/docker-entrypoint-initdb.d");
$filesToGenerate->push(['extra-databases.sql', 'tools/docker/images/database/root/docker-entrypoint-initdb.d/extra-databases.sql']);
}
if (false !== Arr::get($configurationData, "justfile", true)) {
$filesToGenerate->push(['justfile', 'justfile']);
}