Play framework 2.0.1 keeps trying to evolve wrong database type

那年仲夏 提交于 2019-12-05 18:45:28

I noticed the MySQL environment variables in your application.conf are incorrect. The correct MySQL environment variable names are:

OPENSHIFT_MYSQL_DB_HOST
OPENSHIFT_MYSQL_DB_PORT
OPENSHIFT_MYSQL_DB_USERNAME
OPENSHIFT_MYSQL_DB_PASSWORD

Although I can't test your configuration to see if this change solves your problem, the incorrect variable names seemed worth pointing out.

I opened this issue - as this seems to happen only when trying to run with evolutions when in "production" mode (via play start, for example):

https://github.com/playframework/playframework/issues/1410

I have seen this from my desktop - nothing to do with any cloud provider.

I just encountered the same issue with my own project and I think I know what happened. I am using ANT to build my project. This problem only occurs When I ran the unit test before "play start".

In my unit test codes, I am testing it using H2DB. As a result, play spits out 1.sql in H2 syntax, which replaces the original 1.sql created for mysql database. After the test is run, play saw that 1.sql already exists so it wont bother generate another one and use the one generated for H2DB and the error occurs. My solution is to delete 1.sql after running unit tests in my Ant script. Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!