I am using Scala Play version 2.3.1 with the following environments
- Development on a Laptop
- Test with a Heroku deployment
- Live with a Heroku deployment
I am making a change to the database structure using evolutions. It was a little complicated involving the removal of indexes and the adding of others. This is evolution 5. Test and live are currently on evolution 4.
If I blow away the database on my development machine, the application works as expected. If I deploy to test I get 'Application Error' when I access any web page
In the logs I get:
play
Run with -DapplyEvolutions.default=true and -DapplyDownEvolutions.default=true if you want to run them automatically, including downs (be careful, especially if your down evolutions drop existing data) Database 'default' needs evolution!
Oops, cannot start the server.
I do actually have -DapplyEvolutions.default=true set, but I don't have the 'downs' enabled (They are destructive and I don't want to execute them). When I go to the database and look at the play-evolutions table I find the following
- 5 rows
- Each column 'applied_at' has a date in it (including row 5)
- Each column 'state' has the value 'applied' in it
I have investigated the database and evolution 5 has been applied. All the changes that evolution 5 requires are done.
So if I was running in development mode, I would probably get the web page 'database default is in an inconsistent state'. I would click the 'Mark it resolved' button, and I could continue
How do I do this when running in 'production mode'?