Skip to content

Commit

Permalink
Merge pull request #7 from Integritus/patch-1
Browse files Browse the repository at this point in the history
Adding extra option to allow clean on validation error
  • Loading branch information
crossroad0201 authored Nov 14, 2018
2 parents 9e1e9c6 + ac7ac42 commit bdf1de9
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ object FlywayOption {
import scala.collection.JavaConverters._
conf.asScala.flatMap {
case ("flyway.outOfOrder", enabled) => Some(OutOfOrder(enabled.toBoolean))
case ("flyway.cleanOnValidationError", enabled) => Some(CleanOnValidationError(enabled.toBoolean))
case _ => None
}.toSeq
}
Expand All @@ -48,3 +49,10 @@ case class OutOfOrder(enabled: Boolean) extends FlywayOption {
flyway
}
}

case class CleanOnValidationError(enabled: Boolean) extends FlywayOption {
override def apply(flyway: Flyway) = {
flyway.setCleanOnValidationError(enabled)
flyway
}
}

0 comments on commit bdf1de9

Please sign in to comment.