From 61ca864c15b66ceb0e6ec91cb41a6dd25510a801 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Thu, 16 Nov 2017 15:36:37 +0200 Subject: [PATCH] adding fallback DATABASE_URL to avoid connecting to the db during cache:warmup --- .../1.6/config/packages/doctrine.yaml | 13 ++++++++++++- doctrine/doctrine-bundle/1.6/post-install.txt | 4 +++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml b/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml index 64f43cd5..1509b5b4 100644 --- a/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml +++ b/doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml @@ -1,8 +1,19 @@ +parameters: + # update these for your app + doctrine.database_server: mysql + doctrine.server_version: 5.7 + + # adds a fallback URL if the env var is not set + # this is useful to allow you to run cache:warmup + # even when your environment variables don't yet exist + # you should not need to change this value + DATABASE_URL: '%doctrine.database_server%://' + doctrine: dbal: # With Symfony 3.3, remove the `resolve:` prefix url: '%env(resolve:DATABASE_URL)%' - server_version: 5.7 + server_version: '%doctrine.server_version%' orm: auto_generate_proxy_classes: '%kernel.debug%' naming_strategy: doctrine.orm.naming_strategy.underscore diff --git a/doctrine/doctrine-bundle/1.6/post-install.txt b/doctrine/doctrine-bundle/1.6/post-install.txt index 5b5c44ab..e97f842f 100644 --- a/doctrine/doctrine-bundle/1.6/post-install.txt +++ b/doctrine/doctrine-bundle/1.6/post-install.txt @@ -3,4 +3,6 @@ * Modify your DATABASE_URL config in .env - * Check your server_version in config/packages/doctrine.yaml + + * Configure the database_server (mysql) and + server_version (5.7) in config/packages/doctrine.yaml