Skip to content

Commit

Permalink
Disable flyway with param
Browse files Browse the repository at this point in the history
  • Loading branch information
SalamaGofore committed Nov 28, 2023
1 parent d842c7a commit 8ce1d17
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ abstract class ApplicationSettings(config: Config) extends fi.vm.sade.utils.conf
registerMbeans = getBoolean(config, "valinta-tulos-service.valintarekisteri.db.registerMbeans"),
initializationFailTimeout = getLong(config, "valinta-tulos-service.valintarekisteri.db.initializationFailFast"),
leakDetectionThresholdMillis = getLong(config, "valinta-tulos-service.valintarekisteri.db.leakDetectionThresholdMillis"),
flywayEnabled = getBoolean(config, "valinta-tulos-service.valintarekisteri.db.flyway.enabled")
flywayDisabled = getBoolean(config, "valinta-tulos-service.valintarekisteri.db.flyway.disabled")
)
val koutaUsername = config.getString("valinta-tulos-service.cas.username")
val koutaPassword = config.getString("valinta-tulos-service.cas.password")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ case class DbConfig(url: String,
registerMbeans: Option[Boolean],
initializationFailTimeout: Option[Long],
leakDetectionThresholdMillis: Option[Long],
flywayEnabled: Option[Boolean])
flywayDisabled: Option[Boolean])

class ValintarekisteriDb(config: DbConfig, isItProfile:Boolean = false) extends ValintarekisteriRepository
with VastaanottoRepositoryImpl
Expand All @@ -39,7 +39,7 @@ class ValintarekisteriDb(config: DbConfig, isItProfile:Boolean = false) extends
with HyvaksynnanEhtoRepositoryImpl {

logger.info(s"Database configuration: ${config.copy(password = Some("***"))}")
if (config.flywayEnabled.getOrElse(true)) {
if (!config.flywayDisabled.getOrElse(false)) {
val m: FluentConfiguration = Flyway.configure
.dataSource(
config.url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class StoreSijoitteluPerformanceSpec extends Specification with ITSetup with Val
val dbPasswd: String = System.getProperty("db_passwd")

def readSijoitteluFromDb: SijoitteluWrapper = Try(new ValintarekisteriDb(DbConfig(
dbUrl, Some(dbUser), Some(dbPasswd), Some(1), Some(1), Some(1), None, None, None, None, Some(true)), false)) match {
dbUrl, Some(dbUser), Some(dbPasswd), Some(1), Some(1), Some(1), None, None, None, None, Some(false)), false)) match {

case Failure(t) => throw t
case Success(db) => try {
Expand Down

0 comments on commit 8ce1d17

Please sign in to comment.