How to set up different databases per environment in Play 2.0?

后端 未结 5 1835
没有蜡笔的小新
没有蜡笔的小新 2020-12-08 03:02

I\'d like my Play app to use different databases for test, local and production (production is Heroku) environments.

In application.conf I have:

<
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-08 03:16

    Off-topic but if you follow 12-factor-app then having separate configurations named after environments is bad:

    Another aspect of config management is grouping. Sometimes apps batch config into named groups (often called “environments”) named after specific deploys, such as the development, test, and production environments in Rails. This method does not scale cleanly: as more deploys of the app are created, new environment names are necessary, such as staging or qa. As the project grows further, developers may add their own special environments like joes-staging, resulting in a combinatorial explosion of config which makes managing deploys of the app very brittle

    source: http://12factor.net/config

提交回复
热议问题