chore: create the test database on ddev start

This commit is contained in:
fromme committed 2026-09-13 14:57:50 +02:00
1 parent cb407477bf
commit 8ae303d1bc
1 file changed
+8
+8
View File
@@ -305,3 +305,11 @@ corepack_enable: false
## Un-comment to consume async message.
# post-start:
# - exec: symfony run --daemon --watch=config,src,templates,vendor bin/console messenger:consume async -vv
# DDEV's `db` user may only touch the `db` database, so `doctrine:database:create` cannot make
# the `_test` database that `when@test`'s dbname_suffix points at -- it fails with "Access
# denied". Create it as root on every start instead, and hand the `db` user rights to it, so a
# fresh checkout can run `vendor/bin/phpunit` without any manual setup.
hooks:
post-start:
- exec: mysql -uroot -proot -hdb -e "CREATE DATABASE IF NOT EXISTS db_test CHARACTER SET utf8mb4; GRANT ALL ON db_test.* TO 'db'@'%'; FLUSH PRIVILEGES;"