Skip to content

Commit

Permalink
Bump version to flyway-10.9.0
Browse files Browse the repository at this point in the history
Please see the GH release for the release notes

Update Flyway-Community-DB-Support version and reintroduce Oceanblue

Update Mongo JDBC driver to 1.19

Bump Project Lombok to 1.18.30

Closes #3847: Update postgres to 42.7.2 for CVE-2024-1597

Closes #3843: Fixing merge issue for placeholders in TOML files

Increase dependency software.amazon.awssdk:s3 to 2.21.46 to fix CVE-2023-44487
  • Loading branch information
rg-buildmonkey committed Mar 5, 2024
1 parent 85896f5 commit d38d8c3
Show file tree
Hide file tree
Showing 49 changed files with 291 additions and 83 deletions.
1 change: 1 addition & 0 deletions documentation/Flyway CLI and API/Commands/Check Command.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Change and drift reports work on the following databases:
- SQL Server
- PostgreSQL
- Oracle
- MySQL
- SQLite

##### `-code` and `-dryrun`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ Environment variables used to specify a license permit, either by location on di
REDGATE_LICENSING_PERMIT_PATH=path/to/licensePermit.txt
REDGATE_LICENSING_PERMIT=[license permit text here]
```

Depending on where you are running FLyway from, you may run into issues with the length of the permit as some configurations (for example, cmd in Windows) may be unable to store and/or access the full permit in the `REDGATE_LICENSING_PERMIT` environment variable. For this reason we support reading the permit from a file referenced by `REDGATE_LICENSING_PERMIT_PATH`.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ redirect_from: Configuration/group/
## Description
Whether to group all pending migrations together in the same transaction when applying them (only recommended for databases with support for DDL transactions)

_Note: If [executeInTransaction](Configuration/Parameters/Flyway/Execute In Transaction) is set to false, this parameter will have no impact._

## Default
false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ flyway.sqlserver.clean.schemas.exclude=schema1,schema2
## Notes
- This is **only** available for SQL Server
- This is **only** available in the configuration file - no CLI, Maven, Gradle, etc
- When running clean, no users will be dropped to prevent unintended loss of connectivity. You can explicitly remove Users via a [callback script](concepts/callback concept).
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Flyway comes with support for the following provisioners:

## Using Provisioners In TOML Configuration Files
Provisioners are simply configured by setting the [provisioner](Configuration/Parameters/Environments/Provisioner) property on a configured environment
Some provisioners double as property resolvers and allow properties to be computed
Some provisioners double as [property resolvers](Configuration/Property Resolvers) and allow properties to be computed

```toml
[environments.development]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ services = [ "development" ]
waitTimeout = "1m"
```

This example is referencing a docker compose file which might look something like this (not production ready):
This example is referencing a docker compose file which might look something like this (note that this example is not production ready - it is functional but has plain text passwords):
```yaml
services:
development:
Expand All @@ -56,7 +56,7 @@ COPY entrypoint.sh entrypoint.sh
ENTRYPOINT [ "/bin/bash", "entrypoint.sh" ]
```

The bash script in this example (not production ready):
The bash script in this example (note that this example is not production ready - it is functional but not particularly robust):
```shell
#!/bin/bash

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,15 @@ To configure this provisioner:
1. Set the value of the [provisioner parameter](Configuration/Parameters/Environments/Provisioner) to `clone`
2. Set the value of the [environment JDBC URL parameter](Configuration/Parameters/Environments/URL) to `${clone.url}`. This will derive the JDBC URL from Redgate Clone.
* Note that currently for SQL Server the database name needs to be set explicitly after this within the URL parameter as shown in the example below (the JDBC URL returned by Redgate Clone always ends with a `;` so additional properties can be appended)
* For other database flavours it is only possible to connect to the database exposed as the default database on the image
3. Populate the following resolver properties:
- `url` - (Required) The Redgate Clone server URL
- `dataImage` - (Required) The data image to use for creating the container
- `dataContainer` - (Required) The data container to use for the database clone
- `dataContainer` - (Required) The data container to use for the database clone - this needs to be unique
- `dataContainerLifetime` - (Required) The lifetime of the data container. This takes the form of a number optionally followed by a time unit, `s`, `m`, `h`, or `d`. If no time unit is specified, seconds are assumed. `0` can be used to set the lifetime to be unlimited.
- `authenticationToken` - (Required) The token required for authenticating with the Redgate Clone Server. It is recommended to store this as a secret and resolve it using an appropriate [property resolver](Configuration/Property Resolvers).
- `operationTimeout` - (Optional) The amount of time to wait for Redgate Clone operations to complete. This takes the form of a number optionally followed by a time unit, `s`, `m`, `h`, or `d`. If no time unit is specified, seconds are assumed. The default value is `5m`.

If you want to manage the lifetime of the data containers, it is also possible to not set the `provisioner` parameter, and just use this [as a property resolver](Configuration/Property Resolvers/Redgate Clone Resolver).

## Example
This can be used in the TOML configuration like this:
```toml
Expand All @@ -43,3 +42,4 @@ dataContainerLifetime = "1h"
authenticationToken = "${localSecret.RedgateCloneToken}"
```

If you want to manage the lifetime of the data containers, it is also possible to not set the `provisioner` parameter, and just use this [as a property resolver](Configuration/Property Resolvers/Redgate Clone Resolver).
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You should be able to open the project and see a number of modules.
1. Create a new folder `foo` in `org.flywaydb.community.database` to contain your new classes.
1. In the folder create classes `FooDatabase` (subclassed from Database), `FooSchema` (subclassed from Schema), and `FooTable` (subclassed from Table). These classes make up Flyway's internal representation of the parts of your database that it works on.
1. Create class `FooParser` (subclassed from Parser). This represents a simplified version of a parser for your database's dialect of SQL. When finished it will be able to decompose a migration script into separate statements and report on serious errors, but it does not need to fully understand them.
1. Create a class `FooDatabaseType` subclassed from `CommunityDatabaseType` in the folder your created. This class acts as the collation class that brings together all the classes you created before. Implement the required methods. There are also some optional methods you can override to customize the behavior.
1. Create a class `FooDatabaseType` subclassed from `BaseDatabaseType` and implement the `CommunityDatabaseType` interface in the folder your created. This class acts as the collation class that brings together all the classes you created before. Implement the required methods. There are also some optional methods you can override to customize the behavior.
* `createSqlScriptFactory` - To use a custom SqlScriptFactory
* `createSqlScriptExecutorFactory` - To use a custom SqlScriptExecutorFactory
* `createExecutionStrategy` - To use a custom DatabaseExecutionStrategy
Expand Down Expand Up @@ -80,7 +80,7 @@ You should be able to open the project and see a number of modules.
* `doExists()` - to query whether the table described exists in the database
* `doLock()` - to lock the table with a read/write pessimistic lock until the end of the current transaction. This is used to prevent concurrent reads and writes to the schema history while a migration is underway. If your database doesn't support table-level locks, do nothing.

1. Finally, expose your database support to the Flyway engine by adding the full qualified name of your `CommunityDatabaseType` class to `<your module>/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin`
1. Finally, expose your database support to the Flyway engine by adding the full qualified name of your `BaseDatabaseType` class to `<your module>/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin`

### How to test your plugin
#### Testing with a prebuilt Flyway CLI package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ subtitle: MongoDB
<dependency>
<groupId>com.github.kornilova203</groupId>
<artifactId>mongo-jdbc-driver</artifactId>
<version>1.18</version>
<version>1.19</version>
<scope>system</scope>
<systemPath>mongo-jdbc-standalone-1.18.jar</systemPath>
<systemPath>mongo-jdbc-standalone-1.19.jar</systemPath>
</dependency>
```
- or `mvn install:install-file -Dfile=mongo-jdbc-standalone-1.18.jar -DgroupId=com.github.kornilova203 -DartifactId=mongo-jdbc-driver -Dversion=1.18 -Dpackaging=jar -DgeneratePom=true`
- or `mvn install:install-file -Dfile=mongo-jdbc-standalone-1.19.jar -DgroupId=com.github.kornilova203 -DartifactId=mongo-jdbc-driver -Dversion=1.19 -Dpackaging=jar -DgeneratePom=true`

- Using Flyway with Gradle?
- Include the latest Flyway MongoDB dependency [here](https://central.sonatype.com/artifact/org.flywaydb/flyway-database-mongodb) as a buildscript dependency
- Include the latest MongoDB driver dependency [here](https://github.com/DataGrip/mongo-jdbc-driver) in your buildscript
- For example:
```groovy
dependencies {
implementation files('mongo-jdbc-standalone-1.18.jar')
implementation files('mongo-jdbc-standalone-1.19.jar')
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,44 @@
</div>
<div class="col-md-9">

<div class="release">
<h2 id="10.9.0">Flyway 10.9.0 (2024-03-05)</h2>

<h3>Bug fixes</h3>
<ul>
<li>Fixing issue where placeholders are not merged properly when using TOML configuration files.</li>
</ul>

<h3>Changes</h3>
<ul>
<li>Update Flyway-Community-DB-Support version to 10.8.0</li>
</ul>

<h3>Database compatibility</h3>
<ul>
<li>Reintroduce Oceanblue</li>
</ul>

<h3>Java compatibility</h3>
<ul>
<li>Update Mongo JDBC driver to <a href="https://github.com/DataGrip/mongo-jdbc-driver/releases/tag/v1.19">1.19</a></li>
<li>Update postgres to 42.7.2 for CVE-2024-1597</li>
<li>Increase dependency software.amazon.awssdk:s3 to 2.21.46 to fix CVE-2023-44487</li>
</ul>

</div>

<div class="release">
<h2 id="10.8.1">Flyway 10.8.1 (2024-02-15)</h2>

<h3>Bug fixes</h3>
<ul>
<li>
<a href="https://github.com/flyway/flyway/issues/3841">Issue 3841</a>
Fix issue with PostgreSQL when running in a transaction
</li>
</ul>

<h3>Database compatibility</h3>
<ul>
<li>Removed Oceanbase from Flyway CLI. If required, please download from <a href="https://central.sonatype.com/artifact/org.flywaydb/flyway-database-oceanbase/overview">Maven Central</a>.</li>
Expand Down
2 changes: 1 addition & 1 deletion documentation/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#

flywayVersion: 10.8.1
flywayVersion: 10.9.0
enterpriseUrl: https://download.red-gate.com/maven/release/com/redgate/flyway
kramdown:
smart_quotes: ["apos", "apos", "quot", "quot"]
Expand Down
33 changes: 28 additions & 5 deletions flyway-commandline/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-parent</artifactId>
<version>10.8.1</version>
<version>10.9.0</version>
</parent>
<artifactId>flyway-commandline</artifactId>
<packaging>jar</packaging>
Expand Down Expand Up @@ -138,27 +138,50 @@
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-ignite</artifactId>
<version>10.7.2</version>
<version>10.8.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-tidb</artifactId>
<version>10.7.2</version>
<version>10.8.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-yugabytedb</artifactId>
<version>10.7.2</version>
<version>10.8.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-clickhouse</artifactId>
<version>10.7.2</version>
<version>10.8.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-oceanbase</artifactId>
<version>10.8.0</version>
<scope>runtime</scope>
</dependency>




















Expand Down
64 changes: 62 additions & 2 deletions flyway-commandline/src/main/assembly/LICENSES-THIRD-PARTY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,7 @@ POSSIBILITY OF SUCH DAMAGE.

Snowflake JDBC ${version.snowflake} (drivers/snowflake-jdbc-${version.snowflake}.jar)
------------------------------------------------------------------
Source: hhttps://github.com/snowflakedb/snowflake-jdbc/blob/master/LICENSE.txt
Source: https://github.com/snowflakedb/snowflake-jdbc/blob/master/LICENSE.txt


Apache License
Expand Down Expand Up @@ -15931,4 +15931,64 @@ jna (lib/*)
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS

Cassandra JDBC ${version.cassandra} (drivers/cassandra-jdbc-wrapper-${version.cassandra}.jar)
------------------------------------------------------------------
Source: https://github.com/ing-bank/cassandra-jdbc-wrapper/blob/release/next/LICENSE
Notice: https://github.com/ing-bank/cassandra-jdbc-wrapper/blob/release/next/NOTICE.txt

Copyright 2020- ING Bank

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

JDBC wrapper of the Java Driver for Apache Cassandra®
Copyright 2020- ING Bank

This product includes software developed by The Apache Software Foundation (http://www.apache.org/).

Apache Cassandra Java Driver
Copyright 2012- The Apache Software Foundation
This product includes software developed as part of the Apache Cassandra Java Driver project
( https://github.com/apache/cassandra-java-driver ).

Apache Commons Collections
Copyright 2001-2023 The Apache Software Foundation
This product includes software developed as part of the Apache Commons Collections project
( https://github.com/apache/commons-collections ).

Apache Commons IO
Copyright 2002-2023 The Apache Software Foundation
This product includes software developed as part of the Apache Commons IO project
( https://github.com/apache/commons-io ).

Apache Commons Lang
Copyright 2001-2023 The Apache Software Foundation
This product includes software developed as part of the Apache Commons Lang project
( https://github.com/apache/commons-lang ).

FasterXML Jackson
Copyright 2012 FasterXML.com
This product includes software developed as part of the Jackson project
( https://github.com/FasterXML/jackson ).

Caffeine
Copyright 2018 Ben Manes
This product includes software developed as part of the Caffeine project
( https://github.com/ben-manes/caffeine ).

Semver4j
Copyright 2022-present Semver4j contributors
This product includes software developed as part of the Semver4j project
( https://github.com/semver4j/semver4j ), which is available under a MIT license.
For details, see https://github.com/semver4j/semver4j/blob/main/LICENSE
10 changes: 10 additions & 0 deletions flyway-commandline/src/main/assembly/component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,16 @@








<include>org.flywaydb:flyway-database-ignite</include>
<include>org.flywaydb:flyway-database-tidb</include>
<include>org.flywaydb:flyway-database-yugabytedb</include>
<include>org.flywaydb:flyway-database-clickhouse</include>
<include>org.flywaydb:flyway-database-oceanbase</include>
</includes>
</dependencySet>
<dependencySet>
Expand All @@ -249,6 +252,13 @@
<exclude>commons-logging:commons-logging</exclude>
</excludes>
</dependencySet>
<dependencySet>
<outputDirectory>drivers/cassandra</outputDirectory>
<useTransitiveFiltering>true</useTransitiveFiltering>
<includes>
<include>com.ing.data:cassandra-jdbc-wrapper</include>
</includes>
</dependencySet>
<dependencySet>
<outputDirectory>drivers</outputDirectory>
<!-- Workaround for https://issues.apache.org/jira/browse/MASSEMBLY-864 -->
Expand Down
2 changes: 1 addition & 1 deletion flyway-commandline/src/main/assembly/flyway
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ else
if [ -z "$JAVA_HOME" ]; then JAVA_CMD=java; else JAVA_CMD=$JAVA_HOME/bin/java; fi
fi

CP="$CLASSPATH:$INSTALLDIR/lib/*:$INSTALLDIR/lib/aad/*:$INSTALLDIR/lib/plugins/*:$INSTALLDIR/lib/oracle_wallet/*:$INSTALLDIR/lib/flyway/*:$INSTALLDIR/drivers/*:$INSTALLDIR/drivers/gcp/*"
CP="$CLASSPATH:$INSTALLDIR/lib/*:$INSTALLDIR/lib/aad/*:$INSTALLDIR/lib/plugins/*:$INSTALLDIR/lib/oracle_wallet/*:$INSTALLDIR/lib/flyway/*:$INSTALLDIR/drivers/*:$INSTALLDIR/drivers/gcp/*:$INSTALLDIR/drivers/cassandra/*"

EXTRA_ARGS=
if $linux; then
Expand Down
2 changes: 1 addition & 1 deletion flyway-commandline/src/main/assembly/flyway.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if "%JAVA_ARGS%"=="" (
set JAVA_ARGS=
)

%JAVA_CMD% -Djava.library.path="%INSTALLDIR%\native" %JAVA_ARGS% -cp "%CLASSPATH%;%INSTALLDIR%\lib\*;%INSTALLDIR%\lib\plugins\*;%INSTALLDIR%\lib\aad\*;%INSTALLDIR%\lib\oracle_wallet\*;%INSTALLDIR%\lib\flyway\*;%INSTALLDIR%\drivers\*;%INSTALLDIR%\drivers\gcp\*" org.flywaydb.commandline.Main %*
%JAVA_CMD% -Djava.library.path="%INSTALLDIR%\native" %JAVA_ARGS% -cp "%CLASSPATH%;%INSTALLDIR%\lib\*;%INSTALLDIR%\lib\plugins\*;%INSTALLDIR%\lib\aad\*;%INSTALLDIR%\lib\oracle_wallet\*;%INSTALLDIR%\lib\flyway\*;%INSTALLDIR%\drivers\*;%INSTALLDIR%\drivers\gcp\*;%INSTALLDIR%\drivers\cassandra\*" org.flywaydb.commandline.Main %*

@REM Exit using the same code returned from Java
EXIT /B %ERRORLEVEL%
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static void main(String[] args) throws Exception {
FlywayTelemetryManager flywayTelemetryManager = null;
if (!StringUtils.hasText(System.getenv("REDGATE_DISABLE_TELEMETRY"))) {
flywayTelemetryManager = new FlywayTelemetryManager(pluginRegister);
flywayTelemetryManager.setRootTelemetryModel(populateRootTelemetry(flywayTelemetryManager.getRootTelemetryModel(), null, false));
flywayTelemetryManager.setRootTelemetryModel(populateRootTelemetry(flywayTelemetryManager.getRootTelemetryModel(), null, null));
}

try {
Expand All @@ -102,7 +102,7 @@ public static void main(String[] args) throws Exception {
Configuration configuration = new ConfigurationManagerImpl().getConfiguration(commandLineArguments);

if (flywayTelemetryManager != null) {
flywayTelemetryManager.setRootTelemetryModel(populateRootTelemetry(flywayTelemetryManager.getRootTelemetryModel(), configuration, LicenseGuard.getPermit(configuration).isRedgateEmployee()));
flywayTelemetryManager.setRootTelemetryModel(populateRootTelemetry(flywayTelemetryManager.getRootTelemetryModel(), configuration, LicenseGuard.getPermit(configuration)));
}

if (!commandLineArguments.skipCheckForUpdate()) {
Expand Down

0 comments on commit d38d8c3

Please sign in to comment.