~jan0sch/smederee

Showing details for patch 17d1518e89a00587de9b2d35e4ab5be1d96b92a5.
2022-09-23 (Fri), 9:05 AM - Jens Grassel - 17d1518e89a00587de9b2d35e4ab5be1d96b92a5

Update flyway to 9.3.1

Summary of changes
6 files modified with 55 lines added and 45 lines removed
  • build.sbt with 1 added and 1 removed lines
  • modules/hub/src/it/scala/de/smederee/hub/AuthenticationMiddlewareTest.scala with 11 added and 9 removed lines
  • modules/hub/src/it/scala/de/smederee/hub/DatabaseMigratorTest.scala with 10 added and 8 removed lines
  • modules/hub/src/it/scala/de/smederee/hub/DoobieAuthenticationRepositoryTest.scala with 11 added and 9 removed lines
  • modules/hub/src/it/scala/de/smederee/hub/DoobieSignupRepositoryTest.scala with 11 added and 9 removed lines
  • modules/hub/src/it/scala/de/smederee/hub/DoobieVcsMetadataRepositoryTest.scala with 11 added and 9 removed lines
diff -rN -u old-smederee/build.sbt new-smederee/build.sbt
--- old-smederee/build.sbt	2025-02-02 06:54:48.827492493 +0000
+++ new-smederee/build.sbt	2025-02-02 06:54:48.827492493 +0000
@@ -325,7 +325,7 @@
       val circe           = "0.14.3"
       val commonMark      = "0.19.0"
       val doobie          = "1.0.0-RC2"
-      val flyway          = "8.5.13"
+      val flyway          = "9.3.1"
       val http4s          = "1.0.0-M37"
       val ip4s            = "3.2.0"
       val jclOverSlf4j    = "1.7.36"
diff -rN -u old-smederee/modules/hub/src/it/scala/de/smederee/hub/AuthenticationMiddlewareTest.scala new-smederee/modules/hub/src/it/scala/de/smederee/hub/AuthenticationMiddlewareTest.scala
--- old-smederee/modules/hub/src/it/scala/de/smederee/hub/AuthenticationMiddlewareTest.scala	2025-02-02 06:54:48.827492493 +0000
+++ new-smederee/modules/hub/src/it/scala/de/smederee/hub/AuthenticationMiddlewareTest.scala	2025-02-02 06:54:48.831492498 +0000
@@ -34,18 +34,20 @@
 final class AuthenticationMiddlewareTest extends BaseSpec with AuthenticationMiddleware {
 
   override def beforeEach(context: BeforeEach): Unit = {
-    val dbConfig       = configuration.database
-    val flyway: Flyway = Flyway.configure().dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
-    val _              = flyway.migrate()
-    val _              = flyway.clean()
-    val _              = flyway.migrate()
+    val dbConfig = configuration.database
+    val flyway: Flyway =
+      Flyway.configure().cleanDisabled(false).dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
+    val _ = flyway.migrate()
+    val _ = flyway.clean()
+    val _ = flyway.migrate()
   }
 
   override def afterEach(context: AfterEach): Unit = {
-    val dbConfig       = configuration.database
-    val flyway: Flyway = Flyway.configure().dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
-    val _              = flyway.migrate()
-    val _              = flyway.clean()
+    val dbConfig = configuration.database
+    val flyway: Flyway =
+      Flyway.configure().cleanDisabled(false).dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
+    val _ = flyway.migrate()
+    val _ = flyway.clean()
   }
 
   test("extractSessionId must return the session id") {
diff -rN -u old-smederee/modules/hub/src/it/scala/de/smederee/hub/DatabaseMigratorTest.scala new-smederee/modules/hub/src/it/scala/de/smederee/hub/DatabaseMigratorTest.scala
--- old-smederee/modules/hub/src/it/scala/de/smederee/hub/DatabaseMigratorTest.scala	2025-02-02 06:54:48.827492493 +0000
+++ new-smederee/modules/hub/src/it/scala/de/smederee/hub/DatabaseMigratorTest.scala	2025-02-02 06:54:48.831492498 +0000
@@ -25,17 +25,19 @@
 
 final class DatabaseMigratorTest extends BaseSpec {
   override def beforeEach(context: BeforeEach): Unit = {
-    val dbConfig       = configuration.database
-    val flyway: Flyway = Flyway.configure().dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
-    val _              = flyway.migrate()
-    val _              = flyway.clean()
+    val dbConfig = configuration.database
+    val flyway: Flyway =
+      Flyway.configure().cleanDisabled(false).dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
+    val _ = flyway.migrate()
+    val _ = flyway.clean()
   }
 
   override def afterEach(context: AfterEach): Unit = {
-    val dbConfig       = configuration.database
-    val flyway: Flyway = Flyway.configure().dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
-    val _              = flyway.migrate()
-    val _              = flyway.clean()
+    val dbConfig = configuration.database
+    val flyway: Flyway =
+      Flyway.configure().cleanDisabled(false).dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
+    val _ = flyway.migrate()
+    val _ = flyway.clean()
   }
 
   test("DatabaseMigrator must update available outdated database") {
diff -rN -u old-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieAuthenticationRepositoryTest.scala new-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieAuthenticationRepositoryTest.scala
--- old-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieAuthenticationRepositoryTest.scala	2025-02-02 06:54:48.827492493 +0000
+++ new-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieAuthenticationRepositoryTest.scala	2025-02-02 06:54:48.831492498 +0000
@@ -30,18 +30,20 @@
 
 final class DoobieAuthenticationRepositoryTest extends BaseSpec {
   override def beforeEach(context: BeforeEach): Unit = {
-    val dbConfig       = configuration.database
-    val flyway: Flyway = Flyway.configure().dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
-    val _              = flyway.migrate()
-    val _              = flyway.clean()
-    val _              = flyway.migrate()
+    val dbConfig = configuration.database
+    val flyway: Flyway =
+      Flyway.configure().cleanDisabled(false).dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
+    val _ = flyway.migrate()
+    val _ = flyway.clean()
+    val _ = flyway.migrate()
   }
 
   override def afterEach(context: AfterEach): Unit = {
-    val dbConfig       = configuration.database
-    val flyway: Flyway = Flyway.configure().dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
-    val _              = flyway.migrate()
-    val _              = flyway.clean()
+    val dbConfig = configuration.database
+    val flyway: Flyway =
+      Flyway.configure().cleanDisabled(false).dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
+    val _ = flyway.migrate()
+    val _ = flyway.clean()
   }
 
   test("createUserSession must create the user session") {
diff -rN -u old-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieSignupRepositoryTest.scala new-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieSignupRepositoryTest.scala
--- old-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieSignupRepositoryTest.scala	2025-02-02 06:54:48.827492493 +0000
+++ new-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieSignupRepositoryTest.scala	2025-02-02 06:54:48.831492498 +0000
@@ -29,18 +29,20 @@
 
 final class DoobieSignupRepositoryTest extends BaseSpec {
   override def beforeEach(context: BeforeEach): Unit = {
-    val dbConfig       = configuration.database
-    val flyway: Flyway = Flyway.configure().dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
-    val _              = flyway.migrate()
-    val _              = flyway.clean()
-    val _              = flyway.migrate()
+    val dbConfig = configuration.database
+    val flyway: Flyway =
+      Flyway.configure().cleanDisabled(false).dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
+    val _ = flyway.migrate()
+    val _ = flyway.clean()
+    val _ = flyway.migrate()
   }
 
   override def afterEach(context: AfterEach): Unit = {
-    val dbConfig       = configuration.database
-    val flyway: Flyway = Flyway.configure().dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
-    val _              = flyway.migrate()
-    val _              = flyway.clean()
+    val dbConfig = configuration.database
+    val flyway: Flyway =
+      Flyway.configure().cleanDisabled(false).dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
+    val _ = flyway.migrate()
+    val _ = flyway.clean()
   }
 
   test("createAccount must create a new account") {
diff -rN -u old-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieVcsMetadataRepositoryTest.scala new-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieVcsMetadataRepositoryTest.scala
--- old-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieVcsMetadataRepositoryTest.scala	2025-02-02 06:54:48.827492493 +0000
+++ new-smederee/modules/hub/src/it/scala/de/smederee/hub/DoobieVcsMetadataRepositoryTest.scala	2025-02-02 06:54:48.831492498 +0000
@@ -62,18 +62,20 @@
     }
 
   override def beforeEach(context: BeforeEach): Unit = {
-    val dbConfig       = configuration.database
-    val flyway: Flyway = Flyway.configure().dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
-    val _              = flyway.migrate()
-    val _              = flyway.clean()
-    val _              = flyway.migrate()
+    val dbConfig = configuration.database
+    val flyway: Flyway =
+      Flyway.configure().cleanDisabled(false).dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
+    val _ = flyway.migrate()
+    val _ = flyway.clean()
+    val _ = flyway.migrate()
   }
 
   override def afterEach(context: AfterEach): Unit = {
-    val dbConfig       = configuration.database
-    val flyway: Flyway = Flyway.configure().dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
-    val _              = flyway.migrate()
-    val _              = flyway.clean()
+    val dbConfig = configuration.database
+    val flyway: Flyway =
+      Flyway.configure().cleanDisabled(false).dataSource(dbConfig.url, dbConfig.user, dbConfig.pass).load()
+    val _ = flyway.migrate()
+    val _ = flyway.clean()
   }
 
   test("createVcsRepository must create a repository entry") {