playframework-evolutions

Play Framework 2.1.1 Deployment Issues

匆匆过客 提交于 2019-12-04 23:40:10
问题 So, I'm trying to deploy my very simple Play Framework 2.1.1 app but whenever I pass flags through the command line for port and to apply database evolutions, they are ignored. For example: sudo play start -Dhttp.port=80 -DapplyEvolutions.default=true Using this command, the server will not start. Both the port and applyEvolutions=true flags are ignored completely and it throws this error: [warn] play - Your production database [default] needs evolutions! [warn] play - Run with

How to apply manually evolutions in tests with Slick and Play! 2.4

白昼怎懂夜的黑 提交于 2019-12-04 02:33:05
I would like to manually run my evolution script at the beginning of each test file. I'm working with Play! 2.4 and Slick 3. According to the documentation, the way to go seems to be: Evolutions.applyEvolutions(database) but I don't manage to get an instance of my database. In the documentation play.api.db.Databases is imported in order to get a database instance but if I try to import it, I get this error: object Databases is not a member of package play.api.db How can I get an instance of my database in order to run the evolution script? Edit: as asked in the comments, here is the entire

Rolling an evolution back

旧城冷巷雨未停 提交于 2019-12-03 22:24:41
This question might seem stupid, but I cannot find any instruction on how to roll back an evolution in Play 2.0. Google only finds pages which say that the "Downs" section of an evolution file is used for that and that's all. Any pointers or instructions will be appreciated. The Downs part is mainly used to revert an Evolution when the script has changed. That is, you have a project with 2.sql applied to the database and then, due to a merge, 2.sql is modified in the source. Play will run Downs on the old version and then Ups on the new 2.sql to ensure the database is in sync with the codebase

Play Framework 2.1.1 Deployment Issues

感情迁移 提交于 2019-12-03 14:11:34
So, I'm trying to deploy my very simple Play Framework 2.1.1 app but whenever I pass flags through the command line for port and to apply database evolutions, they are ignored. For example: sudo play start -Dhttp.port=80 -DapplyEvolutions.default=true Using this command, the server will not start. Both the port and applyEvolutions=true flags are ignored completely and it throws this error: [warn] play - Your production database [default] needs evolutions! [warn] play - Run with -DapplyEvolutions.default=true if you want to run them automatically (be careful) Oops, cannot start the server.

How to handle Play Framework 2 database evolutions in production

倖福魔咒の 提交于 2019-11-28 04:45:47
It seems that whenever I change my models, Play Framework asks me to run a script that deletes my entire schema and recreates it. Obviously this won't work for production, so what is the proper way to handle this in production? Note, I'm using ebean and Postgres, and hosting on heroku. biesior Unfortunately Ebean can create only CREATE DDL (and not UPDATE DDL ) (as answered on their group ), therefore you need to switch to manual evolutions ASAP. some rules: Always backup your live DB before implementing any changes :) ebean plugin recreates whole DDL if it has only 1.sql evolution created by

How to handle Play Framework 2 database evolutions in production

僤鯓⒐⒋嵵緔 提交于 2019-11-27 00:31:36
问题 It seems that whenever I change my models, Play Framework asks me to run a script that deletes my entire schema and recreates it. Obviously this won't work for production, so what is the proper way to handle this in production? Note, I'm using ebean and Postgres, and hosting on heroku. 回答1: Unfortunately Ebean can create only CREATE DDL (and not UPDATE DDL ) (as answered on their group), therefore you need to switch to manual evolutions ASAP. some rules: Always backup your live DB before