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.
相关问题
- Play framework 2 : How to pass object between rout
- Cannot find sbt launcher 0.11.2
- Play! Framework - Can my view template be localise
- How to access SBT settings from Java code in PlayF
- Play framework: Why the cookie isn't showing
相关文章
- how to set H2 primary key id to auto_increment?
- Build maven project as a part of SBT build
- How does @Inject in Scala work
- how to handle fileupload into a table in play fram
- How to extend the Play2 scala zentasks authenticat
- Playframework & Guice without routing
- Is there a more appropriate way to set the languag
- Background jobs with Play Framework on Heroku
For play 2.4.x, according to the play documentation, you just need to call
Evolutions.cleanupEvolutions(database)
after the test. See here https://www.playframework.com/documentation/2.4.x/ScalaTestingWithDatabasesThe 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.
As far as I know there is no way to trigger Downs by itself, as the purpose of an Evolution is to prepare the database to work with your code, and applying just one Downs step would leave the application in an inconsistent state with many potential errors arising.
If you really need to revert something, that would be a new Evolution (3.sql) where Ups would do the changes required.