Skip to content

Instantly share code, notes, and snippets.

@iref
Last active September 4, 2015 11:19
Show Gist options
  • Save iref/d7493f9b8b390efaa26e to your computer and use it in GitHub Desktop.
Save iref/d7493f9b8b390efaa26e to your computer and use it in GitHub Desktop.
Running evolutions with Compile-time DI
trait ApplicationComponent extends BuiltInComponents with SlickComponents
with I18nComponents with EvolutionsComponents with SlickEvolutionsComponents {
lazy val dbConfigProvider: DatabaseConfigProvider = new DatabaseConfigProvider {
override def get[P <: BasicProfile]: DatabaseConfig[P] = api.dbConfig(DbName("default"))
}
lazy val router: Router = wire[Routes] withPrefix "/"
lazy val assets: Assets = wire[Assets]
lazy val webJarAssets: WebJarAssets = wire[WebJarAssets]
lazy val dynamicEvolutions: DynamicEvolutions = new DynamicEvolutions
def onStart() = {
applicationEvolutions
}
onStart()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment