From 8d2037d948b01b4c1261787534e3405fd16119e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20Brychta?= Date: Fri, 4 Oct 2024 11:33:52 +0100 Subject: [PATCH 1/2] Update TableProvisioner.scala --- .../tei/id_extractor/database/TableProvisioner.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tei_adapter/tei_id_extractor/src/main/scala/weco/catalogue/tei/id_extractor/database/TableProvisioner.scala b/tei_adapter/tei_id_extractor/src/main/scala/weco/catalogue/tei/id_extractor/database/TableProvisioner.scala index fe9e3ea9d0..6c17cbeef1 100644 --- a/tei_adapter/tei_id_extractor/src/main/scala/weco/catalogue/tei/id_extractor/database/TableProvisioner.scala +++ b/tei_adapter/tei_id_extractor/src/main/scala/weco/catalogue/tei/id_extractor/database/TableProvisioner.scala @@ -10,18 +10,20 @@ class TableProvisioner( ) { def provision(): Unit = { - val flyway = new Flyway() - flyway.setDataSource( + val flyway = Flyway.configure() + .dataSource( s"jdbc:mysql://${rdsClientConfig.host}:${rdsClientConfig.port}/${pathIdConfig.database}", rdsClientConfig.username, rdsClientConfig.password ) - flyway.setPlaceholders( + .placeholders( Map( "database" -> pathIdConfig.database, "tableName" -> pathIdConfig.tableName ).asJava ) + .load() + flyway.migrate() } From 730b3096f0484d52f451693a70594d7f6b37e644 Mon Sep 17 00:00:00 2001 From: Github on behalf of Wellcome Collection Date: Fri, 4 Oct 2024 10:35:33 +0000 Subject: [PATCH 2/2] Apply auto-formatting rules --- .../database/TableProvisioner.scala | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tei_adapter/tei_id_extractor/src/main/scala/weco/catalogue/tei/id_extractor/database/TableProvisioner.scala b/tei_adapter/tei_id_extractor/src/main/scala/weco/catalogue/tei/id_extractor/database/TableProvisioner.scala index 6c17cbeef1..d99de6e4d6 100644 --- a/tei_adapter/tei_id_extractor/src/main/scala/weco/catalogue/tei/id_extractor/database/TableProvisioner.scala +++ b/tei_adapter/tei_id_extractor/src/main/scala/weco/catalogue/tei/id_extractor/database/TableProvisioner.scala @@ -10,18 +10,19 @@ class TableProvisioner( ) { def provision(): Unit = { - val flyway = Flyway.configure() + val flyway = Flyway + .configure() .dataSource( - s"jdbc:mysql://${rdsClientConfig.host}:${rdsClientConfig.port}/${pathIdConfig.database}", - rdsClientConfig.username, - rdsClientConfig.password - ) - .placeholders( - Map( - "database" -> pathIdConfig.database, - "tableName" -> pathIdConfig.tableName - ).asJava - ) + s"jdbc:mysql://${rdsClientConfig.host}:${rdsClientConfig.port}/${pathIdConfig.database}", + rdsClientConfig.username, + rdsClientConfig.password + ) + .placeholders( + Map( + "database" -> pathIdConfig.database, + "tableName" -> pathIdConfig.tableName + ).asJava + ) .load() flyway.migrate()