For play 1.x, we can use play evolutions:apply, How can I do it in play-2.0-beta?
For play 1.x, we can use play evolutions:apply , How can I do it
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Evolution:apply is run automatically upon application start up. What is missing in Play 2.0-rc1 is a way to generate the evolutions scripts, and to manually apply them from the SBT console.
But here is how to create them manually.
Say you have the following definition in
application.confPlay2 will look for evolution in the following folder:
application/db/evolutions/mydb/In this folder, evolutions shall be stored as sql file, using the evolution step as the file name.
For instance:
Now the sql itself has the following structure:
!Ups are used to upgrade the model to the next evolutions
!Downs are used to revert the !Ups
Like I said in the intro, evolutions will be magically applied upon application startup.