Skip to content

Commit

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

Bump Flyway-Community-DB-Support to 10.7.2

bump AWS secrets manager version

handle FORCE when defining Oracle views

clarify oracle SQL syntax docs

document workaround for using MySQL with CLI
  • Loading branch information
rg-buildmonkey committed Feb 8, 2024
1 parent 43b4a83 commit bf907e6
Show file tree
Hide file tree
Showing 48 changed files with 168 additions and 59 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ target

documentation/.jekyll-metadata
documentation/_site
documentation/_vale_config/styles/Microsoft
documentation/_vale_config/styles/proselint

**/.idea/**
!**/.idea/runConfigurations/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ While migrations are sufficient for most needs, there are certain situations tha
over and over again</strong>. This could be recompiling procedures, updating materialized views and many other types of housekeeping.

For this reason, Flyway offers you the possibility to **hook into its lifecycle** by using Callbacks.
In order to use these callbacks, name a script after the callback name (ie. afterMigrate.sql) and drop it alongside your other scripts in your migrations folder. Flyway will then invoke it when the execution event criteria listed below is met.

These are the events Flyway supports:
<table class="table table-hover">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is a [property resolver](Configuration/Property Resolvers) which applies wh
Connections made using this form of authentication without this resolver will have the default behavior of prompting for login on every database call.
When using this resolver, with the appropriate Azure setup, documented [here](https://documentation.red-gate.com/flyway/learn-more-about-flyway/database-connections-in-flyway-desktop/using-azure-interactive-authentication), you can connect once and your token will be cached and reused for a period of time.

To configure this set the value of the accessToken [JDBC property](Configuration/Parameters/Environments/JDBC Properties) to `${azureAdInteractive.token}` and supply the `tenantId` and `clientId` resolver properties.
To configure this set the value of the `accessToken` [JDBC property](<Configuration/Parameters/Environments/JDBC Properties>) to `${azureAdInteractive.token}` and supply the `tenantId` and `clientId` resolver properties.
Alternatively, this can be configured using Flyway Desktop.

## Example
Expand Down
10 changes: 5 additions & 5 deletions documentation/Flyway CLI and API/Configuration/Provisioners.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ subtitle: Provisioners
# Provisioners
{% include enterprise.html %}

Provisioners allow flyway to provision a database which does not exist yet before connecting to it, or potentially to reprovision an existing database, restoring the database back to a known state.
Provisioners allow flyway to provision a database which does not exist yet before connecting to it, or potentially to re-provision an existing database, restoring the database back to a known state.

Flyway comes with support for the following provisioners:
- [Clean](Configuration/Provisioners/Clean Provisioner)
Expand Down Expand Up @@ -38,10 +38,10 @@ Common use cases of provisioning are:
* Restoring a development database from a clone or snapshot of production
* Spinning up a development database with appropriate state on a git branch switch

Note that not all provisioner types will support provisioning. The [clean provisioner](Configuration/Provisioners/Clean Provisioner) is a method for reprovisioning only.
Note that not all provisioner types will support provisioning. The [clean provisioner](Configuration/Provisioners/Clean Provisioner) is a method for re-provisioning only.

## Reprovisioning
Reprovisioning consists of resetting a database to a known state. This could be cleaning it and leaving it empty or resetting it to a populated state, such as a snapshot of production.
## Re-provisioning
Re-provisioning consists of resetting a database to a known state. This could be cleaning it and leaving it empty or resetting it to a populated state, such as a snapshot of production.

Reprovisioning is currently only triggered programmatically or via Flyway Desktop. In Flyway Desktop it is triggered for the [shadow database](https://documentation.red-gate.com/flyway/flyway-desktop/terminology-reference/shadow-database-or-shadow-schema) whenever the state is stale and needs to be reset.
Re-provisioning is currently only triggered programmatically or via Flyway Desktop. In Flyway Desktop it is triggered for the [shadow database](https://documentation.red-gate.com/flyway/flyway-desktop/terminology-reference/shadow-database-or-shadow-schema) whenever the state is stale and needs to be reset.
In this context, if it is used to reset to a baseline state, then it avoids the need for generating and executing a baseline migration script, which can be tricky with databases which have cross-database dependencies, or are very large.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ subtitle: Clean Provisioner
# Clean Provisioner
{% include enterprise.html %}

This [provisioner](Configuration/Provisioners) allows for reprovisioning of databases using [clean](Commands/Clean).
This [provisioner](Configuration/Provisioners) allows for re-provisioning of databases using [clean](Commands/Clean).
It is used as the default mechanism in Flyway Desktop for resetting the [shadow database](https://documentation.red-gate.com/flyway/flyway-desktop/terminology-reference/shadow-database-or-shadow-schema) whenever the state is stale.

This affects reprovisioning only, and has no effect on provisioning. It can only be used with pre-existing databases.
This affects re-provisioning only, and has no effect on provisioning. It can only be used with pre-existing databases.

To configure this provisioner, set the value of the [provisioner parameter](Configuration/Parameters/Environments/Provisioner) to `clean`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ subtitle: Docker Provisioner
# Docker Provisioner - Preview
{% include enterprise.html %}

This [provisioner](Configuration/Provisioners) allows for the provisioning and reprovisioning of databases using Docker, specifically leveraging the Docker compose functionality
This [provisioner](Configuration/Provisioners) allows for the provisioning and re-provisioning of databases using Docker, specifically leveraging the Docker compose functionality

Prerequisites:
* Either create or use an existing Docker compose file, which defines one or more services which will provision a database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
subtitle: Redgate Clone Provisioner
---
# Redgate Clone Provisioner - Preview
This [provisioner](Configuration/Provisioners) allows for the provisioning and reprovisioning of databases using [Redgate Clone](https://www.red-gate.com/products/redgate-clone/?_ga=2.146246964.1042910986.1704804078-728513631.1704372124).
This [provisioner](Configuration/Provisioners) allows for the provisioning and re-provisioning of databases using [Redgate Clone](https://www.red-gate.com/products/redgate-clone/?_ga=2.146246964.1042910986.1704804078-728513631.1704372124).

Common use cases of the Redgate Clone provisioner are:
* Restoring a development database from a clone or snapshot of production
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ The default file paths are:

### Why are there other sections in the config?

These belong to other Redgate products and are used by those products. They do not impact Flyway.
The new configuration format allows separating configuration into domains (tables in TOML definition) and these are used to facilitate expansion and coordination in the Flyway suite.


### Why am I getting "unknown configuration parameters" errors?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ This is a quick and easy way to verify that things are working as you expect


#### Testing Flyway with source code
This is more complex but allows you to breakpoint and debug more easily.
This is more complex but allows you to set breakpoints and debug more easily.

Get your environment setup for [developing flyway](Contribute/Code)

Expand Down
2 changes: 2 additions & 0 deletions documentation/Flyway CLI and API/Supported Databases/MySQL.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ subtitle: MySQL
### Compatibility

- If a MySQL driver is not present on the project classpath, MariaDB will be used as a fallback driver. If this is not desired, add `disableMariaDbDriver` to your database URL.
- Since Flyway 10.7.0, the MariaDB driver included in the Flyway Commandline no longer accepts MySQL URLs by default.
To continue using MySQL URLs with the MariaDB driver, add `permitMysqlScheme=true` to your database URL.

## Java Usage
MySQL support is a separate dependency for Flyway and will need to be added to your Java project to access these features.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ dependencies {

## SQL Script Syntax

- [Standard SQL syntax](Concepts/migrations#sql-based-migrations#syntax) with statement delimiter `;`
- PL/SQL blocks starting with `DECLARE` or `BEGIN` and finishing with `END; /`
- Standard SQL statements ending with the semicolon (`;`) delimiter are handled as normal.
- PL/SQL blocks and SQL*Plus statements must be delimited by `/` on a new line.

### Compatibility

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

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

<h3>Bug fixes</h3>
<ul>
<li>Flyway errors running `check -dryrun` for MongoDB</li>
<li>Fixed a bug with the Oracle PL/SQL parser which caused certain view definitions containing the 'FORCE' keyword to break.</li>
<li>
<a href="https://github.com/flyway/flyway/issues/3837">Issue 3837</a>
Parameter settings through Environment variables got ignored if combined with command line parameter settings
</li>
</ul>

<h3>Changes</h3>
<ul>
<li>Bump Flyway-Community-DB-Support to 10.7.2</li>
<li>Update AWS secrets manager JDBC dependency to 2.0.2.</li>
<li>Flyway matches Oracle SQL*Plus behavior when parsing 'SHOW ERR[ORS]'.</li>
</ul>

<h3>Database compatibility</h3>
<ul>
<li>Add Community DB Support for Oceanbase</li>
</ul>

<p>
Thanks to jerdaane for reporting these issues.
</p>
</div>

<div class="release">
<h2 id="10.7.1">Flyway 10.7.1 (2024-01-30)</h2>

<h3>Breaking changes</h3>
<ul>
<li>The Flyway Commandline package no longer includes dependencies for Apache Derby. This is due to CVE-2022-46337. Apache have not released Java-17 compatible jars with the vulnerability fixed, so users will have to acquire their own Derby dependencies. See <a href="https://documentation.red-gate.com/flyway/flyway-cli-and-api/supported-databases/derby">Flyway Derby database support</a> for details</li>
</ul>

<h3>Bug fixes</h3>
<ul>
<li>Fix to filter on Cloud Spanner table schema name when selecting all foreign key constraints. This is to make sure that no system constraints are included in the results if they were to be added in the future. Additionally if Cloud Spanner starts supporting named user schemas, the listed foreign keys are consistent with the tables that are used, which are all filtered based on an empty schema name.</li>
<li>Fixed issues caused by dollar signs and backslashes in property resolver values.</li>
<li>Fix configuring JDBC Properties in command line environment configuration</li>
</ul>

<h3>Changes</h3>
<ul>
<li>Improved formatting of Dry Run report.</li>
<li>The configFiles parameter respects interpreting your configuration in the appropriate format</li>
<li>Make Flyway "Output Query Results" an open source feature</li>
</ul>

<h3>Database compatibility</h3>
<ul>
<li>Added support for <a href="https://documentation.red-gate.com/flyway/flyway-cli-and-api/supported-databases/clickhouse-database">Clickhouse</a> in Flyway - thanks to the community for the contribution</li>
<li>To help increase Flyway's community contribution support, <code>flyway-community-db-support/</code> has been moved to separate repository: <a href="https://github.com/flyway/flyway-community-db-support">flyway/flyway-community-db-support</a>. Any new PRs for database support additions need to be raised <a href="https://github.com/flyway/flyway-community-db-support/pulls">there</a> and any existing PRs in <a href="https://github.com/flyway/flyway">flyway/flyway</a> will need to be transferred by the author.</li>
<li>
<a href="https://github.com/flyway/flyway/issues/3821">Issue 3821</a>
Flyway now supports Snowflake up to version 8.3.
</li>
<li>
<a href="https://github.com/flyway/flyway/issues/3822">Issue 3822</a>
Increase MariaDB JDBC driver to version 3.3.2 and add support for MariaDB 11.2
</li>
</ul>

<h3>New features</h3>
<ul>
<li>If Working Directory is set, Flyway will now use that location to check for default Flyway configuration files in addition to its previous functionality. See updated <a href="https://documentation.red-gate.com/flyway/flyway-cli-and-api/configuration/cli-configuration-order">documentation</a> for more information on default command line configuration order.</li>
<li>allow onEachMigrateOrUndoStatementEvent callback to block statement execution</li>
</ul>

<p>
Thanks to EugenMayer and frichtarik for reporting these issues.
</p>
</div>

<div class="release">
<h2 id="10.6.0">Flyway 10.6.0 (2024-01-16)</h2>

Expand Down Expand Up @@ -247,6 +324,7 @@ <h3>New features</h3>
<h3>Java compatibility</h3>
<ul>
<li>Deprecated Java 8. Java 17 is now required for development</li>
<li>Move packages & groupID from `org.flywaydb.enterprise` to `com.redgate.flyway`. Duplicate packages will be deployed to `org.flywaydb.enterprise` until a future release.</li>
</ul>

<h3>Notes</h3>
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.7.1
flywayVersion: 10.7.2
enterpriseUrl: https://download.red-gate.com/maven/release/com/redgate/flyway
kramdown:
smart_quotes: ["apos", "apos", "quot", "quot"]
Expand Down
13 changes: 12 additions & 1 deletion documentation/_vale_config/_vale.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
StylesPath = styles
Vocab = db, flyway, smells
Vocab = db,flyway,smells
MinAlertLevel = error

Packages = Microsoft, proselint

[*.{md,htm,html}]
# Ignore the Jekyll inclusion filenames
TokenIgnores = `({%[\s]+include[\s]+[a-z]+\.html[\s]+%})`gi
# Some tests for https://regex101.com/
# <td>beforeEachMigrateStatement {% include redgate.html %}</td>
# blah redgate.html
# something else.html and another one.html
# <td>beforeEachMigrateStatement {% include redgate.html %}</td>
# blah INCLuDE blah.HtMl %}

BasedOnStyles = Vale, Microsoft, proselint

proselint.Typography = OFF
Microsoft.Contractions = OFF
Microsoft.Spacing = OFF
Expand All @@ -15,3 +25,4 @@ Microsoft.HeadingColons = OFF
Microsoft.Negative = OFF
Microsoft.Auto = OFF
proselint.Very = OFF

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Clickhouse
[Ii]nformix
(?i)MariaDB
Percona
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Adoptium
(?i)configFiles
(?i)Dapr
[Dd]atagrip
Dockerfile
[Dd]ropwizard
flyway[.-]
flyway_schema_history
Expand Down Expand Up @@ -39,6 +40,7 @@ Xerial
baselineVersion

afterBaseline
afterConnect
afterClean
afterInfo
afterMigrate
Expand Down
10 changes: 5 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.7.1</version>
<version>10.7.2</version>
</parent>
<artifactId>flyway-commandline</artifactId>
<packaging>jar</packaging>
Expand Down Expand Up @@ -138,25 +138,25 @@
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-ignite</artifactId>
<version>10.7.0</version>
<version>10.7.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-tidb</artifactId>
<version>10.7.0</version>
<version>10.7.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-yugabytedb</artifactId>
<version>10.7.0</version>
<version>10.7.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-clickhouse</artifactId>
<version>10.7.0</version>
<version>10.7.2</version>
<scope>runtime</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,24 @@ public Configuration getConfiguration(CommandLineArguments commandLineArguments)
if (commandLineArgumentsModel.getEnvironments().containsKey(ClassicConfiguration.TEMP_ENVIRONMENT_NAME) ||
environmentVariablesModel.getEnvironments().containsKey(ClassicConfiguration.TEMP_ENVIRONMENT_NAME)) {
EnvironmentModel defaultEnv = config.getEnvironments().get(config.getFlyway().getEnvironment());
EnvironmentModel mergedModel = null;

if (environmentVariablesModel.getEnvironments().containsKey(ClassicConfiguration.TEMP_ENVIRONMENT_NAME)) {
EnvironmentModel environmentVariablesEnv = environmentVariablesModel.getEnvironments()
.get(ClassicConfiguration.TEMP_ENVIRONMENT_NAME);
EnvironmentModel mergedModel =
mergedModel =
defaultEnv == null ? environmentVariablesEnv : defaultEnv.merge(environmentVariablesEnv);
config.getEnvironments().put(config.getFlyway().getEnvironment(), mergedModel);
}

if (commandLineArgumentsModel.getEnvironments().containsKey(ClassicConfiguration.TEMP_ENVIRONMENT_NAME)) {
EnvironmentModel commandLineArgumentsEnv = commandLineArgumentsModel.getEnvironments()
.get(ClassicConfiguration.TEMP_ENVIRONMENT_NAME);
EnvironmentModel mergedModel =
defaultEnv == null ? commandLineArgumentsEnv : defaultEnv.merge(commandLineArgumentsEnv);
mergedModel = mergedModel == null ?
defaultEnv == null ? commandLineArgumentsEnv : defaultEnv.merge(commandLineArgumentsEnv) :
mergedModel.merge(commandLineArgumentsEnv);
}

if (mergedModel != null) {
config.getEnvironments().put(config.getFlyway().getEnvironment(), mergedModel);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public static RootTelemetryModel populateRootTelemetry(RootTelemetryModel rootTe
String currentTier = LicenseGuard.getTierAsString(configuration);
rootTelemetryModel.setApplicationEdition(currentTier);
rootTelemetryModel.setApplicationVersion(VersionPrinter.getVersion());
rootTelemetryModel.setTrial(LicenseGuard.getPermit(configuration).isTrial());
ConfigurationModel modernConfig = configuration.getModernConfig();
if (modernConfig != null && StringUtils.hasText(modernConfig.getId())) {
rootTelemetryModel.setProjectId(EncryptionUtils.hashProjectId(modernConfig.getId(), "fur"));
Expand Down
2 changes: 1 addition & 1 deletion flyway-core/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.7.1</version>
<version>10.7.2</version>
</parent>
<artifactId>flyway-core</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
import lombok.Setter;

import java.time.LocalDateTime;
import lombok.experimental.Tolerate;

@NoArgsConstructor
public class HtmlResult implements OperationResult {
@Getter

@Setter
private String timestamp;
@Getter
Expand All @@ -41,7 +42,8 @@ public HtmlResult(LocalDateTime timestamp, String operation) {
this.operation = operation;
}

public void setTimestamp(LocalDateTime timestamp) {
@Tolerate
public void setTimestamp(final LocalDateTime timestamp) {
this.timestamp = timestamp.toString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class RootTelemetryModel {
private String applicationVersion;
private String applicationEdition;
private boolean redgateEmployee;
private boolean isTrial;

private Instant startTime = Instant.now();
}

0 comments on commit bf907e6

Please sign in to comment.