Skip to content

Instantly share code, notes, and snippets.

@t3hnar
Last active August 29, 2015 13:56
Show Gist options
  • Save t3hnar/9342192 to your computer and use it in GitHub Desktop.
Save t3hnar/9342192 to your computer and use it in GitHub Desktop.
lazy val flyway = new Flyway {
setDataSource(dataSource)
}
def migrateToLatestDbVersion() {
try flyway.migrate() catch {
case e: FlywayException if e.getMessage.startsWith("Unable to check whether schema") =>
flyway.init()
flyway.migrate()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment