OfflineEvolutions.applyScript(new File("."),this.getClass().getClassLoader(), "default")
Assuming that you are using "default" as the key in your application.conf :). Hope it helps!
www.caelum.com.br
www.leanpub.com/playframeworknapratica
www.alots.wordpress.com/
--
You received this message because you are subscribed to a topic in the Google Groups "play-framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/play-framework/NTp3WtoQG2E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to play-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
how to execute OfflineEvolutions?
import java.io.File
import play.api.db.DBApi
import play.api.db.evolutions.OfflineEvolutions
import play.api.inject.guice.GuiceApplicationBuilder
object ApplyEvolutions extends App {
val app = new GuiceApplicationBuilder().build()
val dbApi = app.injector.instanceOf[DBApi]
OfflineEvolutions.applyScript(new File("."), this.getClass.getClassLoader, dbApi, "default")
app.stop()
}And if you want to be able to run this on Heroku, have a Procfile like:
web: target/universal/stage/bin/foo -Dhttp.port=$PORT -Dplay.modules.disabled.0=play.api.db.DBModule -Dplay.modules.disabled.1=play.api.db.evolutions.EvolutionsModule
applyevolutions: target/universal/stage/bin/foo -main ApplyEvolutions
Then run:
heroku run applyevolutions