Skip to content

Commit 3b32b15

Browse files
Update flyway.version to v10 (release/4.0.x) (major) (#525)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jochen Schalanda <[email protected]>
1 parent e7b58cd commit 3b32b15

File tree

6 files changed

+44
-83
lines changed

6 files changed

+44
-83
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
java-version: ['11', '17', '21']
16+
java-version: ['17', '21']
1717
uses: dropwizard/workflows/.github/workflows/maven.yml@main
1818
secrets: inherit
1919
with:

.java-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.8
1+
17

README.md

+31-24
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Dropwizard Flyway
22
=================
33

4-
[![Build](https://github.com/dropwizard/dropwizard-flyway/workflows/Build/badge.svg)](https://github.com/dropwizard/dropwizard-flyway/actions?query=workflow%3ABuild)
4+
[![Build](https://github.com/dropwizard/dropwizard-flyway/actions/workflows/build.yml/badge.svg)](https://github.com/dropwizard/dropwizard-flyway/actions/workflows/build.yml)
55
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dropwizard_dropwizard-flyway&metric=alert_status)](https://sonarcloud.io/dashboard?id=dropwizard_dropwizard-flyway)
66
[![Maven Central](https://img.shields.io/maven-central/v/io.dropwizard.modules/dropwizard-flyway.svg)](https://search.maven.org/artifact/io.dropwizard.modules/dropwizard-flyway)
77

@@ -11,7 +11,7 @@ Dropwizard Flyway
1111
Usage
1212
-----
1313

14-
Just add the `FlywayBundle` to your Dropwizard application inside the [`Application#initialize`](https://javadoc.io/static/io.dropwizard/dropwizard-core/2.0.0/io/dropwizard/Application.html#initialize-io.dropwizard.setup.Bootstrap-) method.
14+
Just add the `FlywayBundle` to your Dropwizard application inside the [`Application#initialize`](https://javadoc.io/static/io.dropwizard/dropwizard-core/4.0.0/io/dropwizard/core/Application.html#initialize(io.dropwizard.core.setup.Bootstrap) method.
1515

1616
@Override
1717
public void initialize(Bootstrap<MyConfiguration> bootstrap) {
@@ -47,9 +47,9 @@ The [Flyway migrations](http://flywaydb.org/documentation/migration/) must be ac
4747
Configuration
4848
-------------
4949

50-
`dropwizard-flyway` is using the standard [DataSourceFactory](https://javadoc.io/static/io.dropwizard/dropwizard-db/2.0.0/io/dropwizard/db/DataSourceFactory.html) from [`dropwizard-db`](https://javadoc.io/doc/io.dropwizard/dropwizard-db/2.0.0/index.html) for configuring its [DataSource](http://docs.oracle.com/javase/8/docs/api/javax/sql/DataSource.html).
50+
`dropwizard-flyway` is using the standard [DataSourceFactory](https://javadoc.io/static/io.dropwizard/dropwizard-db/4.0.0/io/dropwizard/db/DataSourceFactory.html) from [`dropwizard-db`](https://javadoc.io/doc/io.dropwizard/dropwizard-db/4.0.0/index.html) for configuring its [DataSource](http://docs.oracle.com/javase/8/docs/api/javax/sql/DataSource.html).
5151

52-
Additionally you can override the following configuration settings of Flyway using [FlywayFactory](https://dropwizard.github.io/dropwizard-flyway/2.0.0-1/apidocs/io/dropwizard/flyway/FlywayFactory.html):
52+
Additionally, you can override the following configuration settings of Flyway using [FlywayFactory](https://dropwizard.github.io/dropwizard-flyway/2.0.0-1/apidocs/io/dropwizard/flyway/FlywayFactory.html):
5353

5454
flyway:
5555
# The encoding of SQL migrations. (default: UTF-8)
@@ -120,7 +120,7 @@ Additionally you can override the following configuration settings of Flyway usi
120120
121121
# Ignore migrations that match this list of patterns when validating migrations.
122122
# Each pattern is of the form described type:status with * matching type or status.
123-
# Please refer to https://flywaydb.org/documentation/configuration/parameters/ignoreMigrationPatterns for details.
123+
# Please refer to https://documentation.red-gate.com/fd/flyway-cli-and-api/configuration/parameters/flyway/ignore-migration-patterns for details.
124124
# Example: repeatable:missing,versioned:pending,*:failed (default: *:future)
125125
ignoreMigrationPatterns:
126126
- "*:future"
@@ -143,7 +143,11 @@ Additionally you can override the following configuration settings of Flyway usi
143143
# If set to true, default built-in resolvers (jdbc, spring-jdbc and sql) are skipped and only custom resolvers as
144144
# defined by 'resolvers' are used. (default: false)
145145
skipDefaultResolvers: false
146-
146+
147+
# The map of <flywaySetting, appliedValue> to overwrite any existing configuration. (default: empty map)
148+
# Properties are documented here: https://documentation.red-gate.com/fd/parameters-224919673.html
149+
configuration:
150+
147151
#### COMMERCIAL FEATURES
148152
# (Flyway Pro and Flyway Enterprise only)
149153
@@ -172,44 +176,47 @@ Additionally you can override the following configuration settings of Flyway usi
172176
# the following errorOverride can be used: 99999:17110:E
173177
#errorOverrides:
174178
175-
# Whether to Flyway's support for Oracle SQL*Plus commands should be activated. (default: false)
176-
oracleSqlPlus: false
177-
178179
# Whether to stream SQL migrations when executing them. (default: false)
179180
stream: false
180181
181182
# Target version up to which Flyway should consider migrations.
182183
# The special value 'current' designates the current version of the schema. (default: <<latest version>>)
183184
#target:
184-
185-
# The file name prefix for undo SQL migrations. (default: U)
186-
# Undo SQL migrations are responsible for undoing the effects of the versioned migration with the same version.
187-
# They have the following file name structure: prefixVERSIONseparatorDESCRIPTIONsuffix ,
188-
# which using the defaults translates to U1.1__My_description.sql
189-
undoSqlMigrationPrefix: U
190-
191-
# The map of <flywaySetting, appliedValue> to overwrite any existing configuration. (default: empty map)
192-
# Properties are documented here: https://documentation.red-gate.com/fd/parameters-184127474.html
193-
configuration:
194-
195185

196186

197187
Maven Artifacts
198188
---------------
199189

200-
![dropwizard-flyway 1.3.x](https://img.shields.io/maven-central/v/io.dropwizard.modules/dropwizard-flyway/1.3)
201-
![dropwizard-flyway 2.0.x](https://img.shields.io/maven-central/v/io.dropwizard.modules/dropwizard-flyway/2.0)
202190
![dropwizard-flyway 2.1.x](https://img.shields.io/maven-central/v/io.dropwizard.modules/dropwizard-flyway/2.1)
191+
![dropwizard-flyway 3.0.x](https://img.shields.io/maven-central/v/io.dropwizard.modules/dropwizard-flyway/3.0)
192+
![dropwizard-flyway 4.0.x](https://img.shields.io/maven-central/v/io.dropwizard.modules/dropwizard-flyway/4.0)
203193

204194
This project is available on Maven Central. To add it to your project simply add the following dependencies to your `pom.xml`:
205195

206-
207196
<dependency>
208197
<groupId>io.dropwizard.modules</groupId>
209198
<artifactId>dropwizard-flyway</artifactId>
210199
<version>${dropwizard-flyway.version}</version>
211200
</dependency>
212201

202+
Please note that you will need to add the respective Flyway database support artifacts and configure them via the `flyway.configuration` map.
203+
204+
Example:
205+
206+
Add Flyway PostgreSQL dependency to your POM:
207+
208+
<dependency>
209+
<groupId>org.flywaydb</groupId>
210+
<artifactId>flyway-database-postgresql</artifactId>
211+
<version>${flyway.version}</version>
212+
</dependency>
213+
214+
Add the configuration setting to your `flyway.configuration` block:
215+
216+
flyway:
217+
configuration:
218+
# PostgreSQL Transactional Lock, see https://documentation.red-gate.com/fd/postgresql-transactional-lock-224919738.html
219+
flyway.postgresql.transactional.lock: false
213220

214221
Support
215222
-------
@@ -220,7 +227,7 @@ Please file bug reports and feature requests in [GitHub issues](https://github.c
220227
License
221228
-------
222229

223-
Copyright (c) 2014-2020 Jochen Schalanda, Dropwizard Team
230+
Copyright (c) 2014-2024 Jochen Schalanda, Dropwizard Team
224231

225232
This library is licensed under the Apache License, Version 2.0.
226233

pom.xml

+10-10
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
</scm>
2828

2929
<ciManagement>
30-
<system>Travis CI</system>
31-
<url>https://travis-ci.org/dropwizard/dropwizard-flyway</url>
30+
<system>GitHub Actions</system>
31+
<url>https://github.com/dropwizard/dropwizard-flyway/actions</url>
3232
</ciManagement>
3333

3434
<issueManagement>
@@ -62,15 +62,15 @@
6262
<properties>
6363
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6464
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
65-
<maven.compiler.release>11</maven.compiler.release>
65+
<maven.compiler.release>17</maven.compiler.release>
6666
<maven.compiler.parameters>true</maven.compiler.parameters>
6767

6868
<sonar.projectKey>dropwizard_dropwizard-flyway</sonar.projectKey>
6969
<sonar.organization>dropwizard</sonar.organization>
7070
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
7171

7272
<dropwizard.version>4.0.6</dropwizard.version>
73-
<flyway.version>9.22.3</flyway.version>
73+
<flyway.version>10.7.2</flyway.version>
7474
</properties>
7575

7676
<dependencyManagement>
@@ -103,12 +103,6 @@
103103
<artifactId>flyway-core</artifactId>
104104
<version>${flyway.version}</version>
105105
</dependency>
106-
<dependency>
107-
<groupId>org.flywaydb</groupId>
108-
<artifactId>flyway-database-oracle</artifactId>
109-
<version>${flyway.version}</version>
110-
<optional>true</optional>
111-
</dependency>
112106
<dependency>
113107
<groupId>org.checkerframework</groupId>
114108
<artifactId>checker-qual</artifactId>
@@ -140,6 +134,12 @@
140134
<artifactId>mockito-junit-jupiter</artifactId>
141135
<scope>test</scope>
142136
</dependency>
137+
<dependency>
138+
<groupId>org.flywaydb</groupId>
139+
<artifactId>flyway-database-postgresql</artifactId>
140+
<version>${flyway.version}</version>
141+
<scope>test</scope>
142+
</dependency>
143143
<dependency>
144144
<groupId>com.h2database</groupId>
145145
<artifactId>h2</artifactId>

src/main/java/io/dropwizard/flyway/FlywayFactory.java

-46
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import org.checkerframework.checker.nullness.qual.Nullable;
99
import org.flywaydb.core.Flyway;
1010
import org.flywaydb.core.api.configuration.FluentConfiguration;
11-
import org.flywaydb.database.oracle.OracleConfigurationExtension;
1211

1312
import javax.sql.DataSource;
1413
import java.io.File;
@@ -105,17 +104,10 @@ public class FlywayFactory {
105104
private List<String> errorOverrides;
106105
@JsonProperty
107106
@Nullable
108-
private Boolean oracleSqlPlus;
109-
@JsonProperty
110-
@Nullable
111107
private Boolean stream;
112108
@JsonProperty
113109
@Nullable
114110
private String target;
115-
@JsonProperty
116-
@Nullable
117-
private String undoSqlMigrationPrefix;
118-
119111
@JsonProperty
120112
@Nullable
121113
Map<String, String> configuration = Collections.emptyMap();
@@ -574,21 +566,6 @@ public void setErrorOverrides(@Nullable List<String> errorOverrides) {
574566
this.errorOverrides = errorOverrides;
575567
}
576568

577-
/**
578-
* @see OracleConfigurationExtension#getSqlplus()
579-
*/
580-
@Nullable
581-
public Boolean isOracleSqlPlus() {
582-
return oracleSqlPlus;
583-
}
584-
585-
/**
586-
* @see OracleConfigurationExtension#setSqlplus(Boolean)
587-
*/
588-
public void setOracleSqlPlus(@Nullable Boolean oracleSqlPlus) {
589-
this.oracleSqlPlus = oracleSqlPlus;
590-
}
591-
592569
/**
593570
* @see FluentConfiguration#isStream()
594571
*/
@@ -619,21 +596,6 @@ public void setTarget(@Nullable String target) {
619596
this.target = target;
620597
}
621598

622-
/**
623-
* @see FluentConfiguration#getUndoSqlMigrationPrefix()
624-
*/
625-
@Nullable
626-
public String getUndoSqlMigrationPrefix() {
627-
return undoSqlMigrationPrefix;
628-
}
629-
630-
/**
631-
* @see FluentConfiguration#undoSqlMigrationPrefix(String)
632-
*/
633-
public void setUndoSqlMigrationPrefix(@Nullable String undoSqlMigrationPrefix) {
634-
this.undoSqlMigrationPrefix = undoSqlMigrationPrefix;
635-
}
636-
637599
/**
638600
* @see FluentConfiguration#configuration(Map)
639601
*/
@@ -705,20 +667,12 @@ private FluentConfiguration createConfiguration() {
705667
if (errorOverrides != null) {
706668
flyway.errorOverrides(errorOverrides.toArray(emptyStringArray));
707669
}
708-
if (oracleSqlPlus != null) {
709-
OracleConfigurationExtension oracleConfigurationExtension =
710-
flyway.getPluginRegister().getPlugin(OracleConfigurationExtension.class);
711-
oracleConfigurationExtension.setSqlplus(oracleSqlPlus);
712-
}
713670
if (stream != null) {
714671
flyway.stream(stream);
715672
}
716673
if (target != null) {
717674
flyway.target(target);
718675
}
719-
if (undoSqlMigrationPrefix != null) {
720-
flyway.undoSqlMigrationPrefix(undoSqlMigrationPrefix);
721-
}
722676

723677
return flyway;
724678
}

src/test/java/io/dropwizard/flyway/FlywayFactoryTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.google.common.collect.ImmutableMap;
44
import jakarta.validation.constraints.NotNull;
55
import org.flywaydb.core.Flyway;
6-
import org.flywaydb.core.internal.database.postgresql.PostgreSQLConfigurationExtension;
6+
import org.flywaydb.database.postgresql.PostgreSQLConfigurationExtension;
77
import org.h2.jdbcx.JdbcDataSource;
88
import org.junit.jupiter.api.BeforeEach;
99
import org.junit.jupiter.api.Test;

0 commit comments

Comments
 (0)