Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always set Doctrine server version & platform #258

Merged
7 commits merged into from
Nov 23, 2017
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions doctrine/doctrine-bundle/1.6/config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
parameters:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"parameters" should be defined via the "container" configurator instead

# Adds a fallback DATABASE_URL if the env var is not set.
# This allows you to run cache:warmup even if your
# environment variables are not available yet.
# You should not need to change this value.
env(DATABASE_URL): ''

doctrine:
dbal:
# configure these for your database server
driver: 'pdo_mysql'
server_version: '5.7'
charset: utf8mb4

# With Symfony 3.3, remove the `resolve:` prefix
url: '%env(resolve:DATABASE_URL)%'
orm:
Expand Down
2 changes: 1 addition & 1 deletion doctrine/doctrine-bundle/1.6/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"#1": "Format described at http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url",
"#2": "For an SQLite database, use: \"sqlite:///%kernel.project_dir%/var/data.db\"",
"#3": "Set \"serverVersion\" to your server version to avoid edge-case exceptions and extra database calls",
"DATABASE_URL": "mysql://db_user:[email protected]:3306/db_name?charset=utf8mb4&serverVersion=5.7"
"DATABASE_URL": "mysql://db_user:[email protected]:3306/db_name"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to mention that one should also not forget to change the doctrine.yaml file? And vice-versa?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I just changed the #3 comment line to mention doctrine.yaml. But I didn't add a note in doctrine.yaml about .env: it seemed weird, because DATABASE_URL is an env variable, so saying "edit it in .env" is only true in dev mode.... I wasn't convinced if it should be added there or not.

}
}
8 changes: 8 additions & 0 deletions doctrine/doctrine-bundle/1.6/post-install.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<bg=blue;fg=white> </>
<bg=blue;fg=white> Next: Configuration </>
<bg=blue;fg=white> </>

* Modify your DATABASE_URL config in <fg=green>.env</>

* Configure the <fg=green>driver</> (mysql) and
<fg=green>server_version</fg> (5.7) in <fg=green>config/packages/doctrine.yaml</>