8000 feature #656 Create 'main' database in Docker by default (Rob Meijer) · symfony/maker-bundle@5dc1544 · GitHub
[go: up one dir, main page]

Skip to content
< 8000 header class="prc-PageLayout-Header-mQXK1" style="--spacing:var(--spacing-none)">

Commit 5dc1544

Browse files
committed
feature #656 Create 'main' database in Docker by default (Rob Meijer)
This PR was merged into the 1.0-dev branch. Discussion ---------- Create 'main' database in Docker by default This adds the MYSQL_DATABASE environment variable to docker-compose.yaml, which enables Docker to create a default database called 'main'. This matches the symfony binary's default expected database. Commits ------- 7d1fc7f Create 'main' database in Docker by default.
2 parents 1285f76 + 7d1fc7f commit 5dc1544

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/Docker/DockerDatabaseServices.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ public static function getDatabaseSkeleton(string $name, string $version): array
3131
'image' => sprintf('mariadb:%s', $version),
3232
'environment' => [
3333
'MYSQL_ROOT_PASSWORD' => 'password',
34+
'MYSQL_DATABASE' => 'main',
3435
],
3536
];
3637
case 'mysql':
3738
return [
3839
'image' => sprintf('mysql:%s', $version),
3940
'environment' => [
4041
'MYSQL_ROOT_PASSWORD' => 'password',
42+
'MYSQL_DATABASE' => 'main',
4143
],
4244
];
4345
case 'postgres':

tests/Maker/MakeDockerDatabaseTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ function (string $output, string $directory) {
6868

6969
self::assertSame('mysql:latest', $mysql['image']);
7070
self::assertSame('password', $mysql['environment']['MYSQL_ROOT_PASSWORD']);
71+
self::assertSame('main', $mysql['environment']['MYSQL_DATABASE']);
7172
self::assertSame(['3306'], $mysql['ports']);
7273
}
7374
),
@@ -94,6 +95,7 @@ function (string $output, string $directory) {
9495

9596
self::assertSame('mariadb:latest', $mariadb['image']);
9697
self::assertSame('password', $mariadb['environment']['MYSQL_ROOT_PASSWORD']);
98+
self::assertSame('main', $mariadb['environment']['MYSQL_DATABASE']);
9799
self::assertSame(['3306'], $mariadb['ports']);
98100
}
99101
),

0 commit comments

Comments
 (0)
0