Skip to content

Commit

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

Prevent modification of PluginRegister directly
  • Loading branch information
rg-buildmonkey committed Mar 14, 2024
1 parent b682387 commit 5511c69
Show file tree
Hide file tree
Showing 46 changed files with 246 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,48 @@ flywayVersion: 5.2.4
---
# Accessing Older Versions of Flyway

Historically, Flyway Community edition artifacts were uploaded to Maven Central and Gradle Plugins, whereas Pro & Enterprise editions were only available through our own server, repo.flywaydb.org.
## Flyway 10.0.0
The `groupId` has been changed from `org.flywaydb.enterprise` to `com.redgate.flyway`.

Since Flyway 6.4.1, Pro & Enterprise edition artifacts are uploaded to Maven Central and Gradle Plugins, alongside Community edition.
For API users, `flyway-core` and `flyway-proprietary` dependencies will need to be updated

### Before
```
<dependency>
<groupId>org.flywaydb.enterprise</groupId>
...
</dependency>
```
### After
```
<dependency>
<groupId>com.redgate.flyway</groupId>
...
</dependency>
```
## Flyway 9.0.0
Since Flyway 9.0.0, non-open source versions of Flyway are hosted on https://download.red-gate.com/maven/release

API users will need to update their project to retrieve artifacts from here.
```
<repositories>
...
<repository>
<id>redgate</id>
<url>https://download.red-gate.com/maven/release</url>
</repository>
...
</repositories>
```

## Flyway 7.0.0
Since Flyway 7.0, Flyway Pro & Enterprise editions are renamed to Flyway Teams.

## Flyway 6.4.1
Historically, Flyway Community edition artifacts were uploaded to Maven Central and Gradle Plugins, whereas Pro & Enterprise editions were only available through our own server, repo.flywaydb.org.

Since Flyway 6.4.1, Pro & Enterprise edition artifacts are uploaded to Maven Central and Gradle Plugins, alongside Community edition.

For all versions of Community, and versions of paid editions beyond 6.4.1:
- [Flyway Maven Central listing](https://mvnrepository.com/artifact/org.flywaydb)
- [Flyway Gradle Plugins listing](https://plugins.gradle.org/search?term=flyway)
Expand Down
10 changes: 1 addition & 9 deletions documentation/Flyway CLI and API/Commands/Undo.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,7 @@ Undoes the most recently applied versioned migration.
{% include commandUsage.html command="Undo" %}
<br/>

API/Maven/Gradle users will need to include `flyway-proprietary` as a dependency in order to use `undo`. For example:

```
<dependency>
<groupId>com.redgate.flyway</groupId>
<artifactId>flyway-proprietary</artifactId>
<version>{{ site.flywayVersion }}</version>
</dependency>
```
API/Maven/Gradle users will need to include `flyway-proprietary` as a dependency in order to use `undo`. See [API (Java)](Usage/API Java)

## Description

Expand Down
11 changes: 2 additions & 9 deletions documentation/Flyway CLI and API/Concepts/Dry Runs.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,8 @@ There are however situations where you may want to

## Usage

API/Maven/Gradle users will need to include `flyway-proprietary` as a dependency in order to use Dry run. For example:

```
<dependency>
<groupId>com.redgate.flyway</groupId>
<artifactId>flyway-proprietary</artifactId>
<version>{{ site.flywayVersion }}</version>
</dependency>
```
API/Maven/Gradle users will need to include `flyway-proprietary` as a dependency in order to use Dry run. See [API (Java)](Usage/API Java)


## How it works

Expand Down
1 change: 0 additions & 1 deletion documentation/Flyway CLI and API/Concepts/Migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ public class V1_2__Another_user extends BaseJavaMigration {
```

## Script migrations
{% include redgate.html %}

Sometimes it may be more desirable to use a scripting language for migrations. Flyway Teams currently supports the `.ps1`, `.bat`, `.cmd`, `.sh`, `.bash`, `.py` file extensions as migrations, and on non-windows platforms it also supports migrations without extensions (assuming a valid [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix))).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ subtitle: flyway.scriptPlaceholderPrefix
---

# Script Placeholder Prefix
{% include teams.html %}

## Description
The prefix of every [script migration placeholder](Configuration/Placeholders Configuration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ subtitle: flyway.scriptPlaceholderSuffix
---

# Script Placeholder Suffix
{% include teams.html %}

## Description
The suffix of every [script migration placeholder](Configuration/Placeholders Configuration)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ redirect_from: Configuration/workingDirectory/
# Working Directory

## Description
The working directory to consider when dealing with relative paths for both config files and locations.
The working directory to consider when dealing with relative paths. If configured, this parameter will affect the below areas:
- Looking for the default [sql](Configuration/Parameters/Flyway/Locations) folder.
- Looking for the default [jars](Configuration/Parameters/Flyway/Jar Dirs) folder.
- Looking for default configuration files.
- The [Locations](Configuration/Parameters/Flyway/Locations) parameter
- The [Report Filename](Configuration/Parameters/Flyway/Report Filename) parameter

## Default
<i>default for client</i>
<i>empty</i>

## Usage

Expand Down Expand Up @@ -44,3 +49,6 @@ Not available
<workingDirectory>sql</workingDirectory>
</configuration>
```

## Notes
If this parameter is left empty, Flyway will use the directory that Flyway is executed in.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ redirect_from: /documentation/placeholders/
Flyway comes with support for placeholder replacement in:

- [SQL migrations](Configuration/Placeholders Configuration#sql-migration-placeholders)
- [Script migrations](Configuration/Placeholders Configuration#script-migration-placeholders) {% include teams.html %}
- [Script migrations](Configuration/Placeholders Configuration#script-migration-placeholders)

# SQL Migration Placeholders
In addition to regular SQL syntax, Flyway also supports placeholder replacement with configurable prefixes and suffixes.
Expand Down Expand Up @@ -67,7 +67,6 @@ INSERT INTO ${tableName} (name) VALUES ('Mr. T');
```

# Script Migration Placeholders
{% include teams.html %}

Much like SQL placeholders, Flyway supports placeholder replacement in
[script migrations](Concepts/migrations#script-migrations). Placeholders can be read
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ subtitle: Aurora MySQL
|------------------------------------|--------------------------------------------------------------------------------------------------------|
| **URL format** | <code>jdbc:mysql://<i>instance</i>.<i>region</i>.rds.amazonaws.com:<i>port</i>/<i>database?usePipelineAuth=false&useBatchMultiSend=false</i></code> |
| **URL format** | Yes - add `?useSsl=true` |
| **Ships with Flyway Command-line** | Yes |
| **Ships with Flyway Command-line** | No |
| **Maven Central coordinates** | `mysql:mysql-connector-java` |
| **Supported versions** | `8.0.12` and later |
| **Default Java class** | `com.mysql.jdbc.Driver` |
Expand Down
14 changes: 10 additions & 4 deletions documentation/Flyway CLI and API/Usage/API (Java).md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ be migrated to a state the rest of the code can work with.
- `Java 17`

## Download
### Flyway Community Edition
<table class="table">
<tr>
<th>Maven</th>
Expand All @@ -36,6 +35,12 @@ be migrated to a state the rest of the code can work with.
&lt;artifactId&gt;flyway-core&lt;/artifactId&gt;
&lt;version&gt;{{ site.flywayVersion }}&lt;/version&gt;
&lt;/dependency&gt;
&lt;!-- If you need Teams features then you'll need this additional dependency --&gt;
&lt;dependency&gt;
&lt;groupId&gt;<strong>com.redgate.flyway</strong>&lt;/groupId&gt;
&lt;artifactId&gt;flyway-proprietary&lt;/artifactId&gt;
&lt;version&gt;{{ site.flywayVersion }}&lt;/version&gt;
&lt;/dependency&gt;
...
&lt;/dependencies&gt;</pre>
</td>
Expand Down Expand Up @@ -70,9 +75,10 @@ dependencies {
</tr>
</table>

<p class="note">
For older versions see <a href="/Accessing Older Versions of Flyway">Accessing Older Versions of Flyway</a>
</p>
Please note, the `groupId` changed at Flyway V10.0.0 from `org.flywaydb.enterprise` to `com.redgate.flyway`

For older versions see <a href="/Accessing Older Versions of Flyway">Accessing Older Versions of Flyway</a>



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

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

<h3>Changes</h3>
<ul>
<li>Improve the way Flyway honors the `workingDirectory` parameter</li>
<li>Flyway OSS won't throw any exception for unknown parameters if the TOML contains non-flyway namespaces.</li>
</ul>

</div>

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

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.9.1
flywayVersion: 10.10.0
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 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.9.1</version>
<version>10.10.0</version>
</parent>
<artifactId>flyway-commandline</artifactId>
<packaging>jar</packaging>
Expand Down Expand Up @@ -292,6 +292,17 @@

















Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ public class LegacyConfigurationManager implements ConfigurationManager {
public Configuration getConfiguration(CommandLineArguments commandLineArguments) {

Map<String, String> config = new HashMap<>();
String workingDirectory = commandLineArguments.isWorkingDirectorySet() ? commandLineArguments.getWorkingDirectory() : ClassUtils.getInstallDir(Main.class);
String installDirectory = commandLineArguments.isWorkingDirectorySet() ? commandLineArguments.getWorkingDirectory() : ClassUtils.getInstallDir(Main.class);
String workingDirectory = commandLineArguments.getWorkingDirectoryOrNull();

File jarDir = new File(workingDirectory, "jars");
File jarDir = new File(installDirectory, "jars");
ConfigUtils.warnIfUsingDeprecatedMigrationsFolder(jarDir, ".jar");
if (jarDir.exists()) {
config.put(ConfigUtils.JAR_DIRS, jarDir.getAbsolutePath());
Expand All @@ -62,13 +63,13 @@ public Configuration getConfiguration(CommandLineArguments commandLineArguments)
config.putAll(envVars);
config = overrideConfiguration(config, commandLineArguments.getConfiguration(false));

File sqlFolder = new File(workingDirectory, DEFAULT_CLI_SQL_LOCATION);
File sqlFolder = new File(installDirectory, DEFAULT_CLI_SQL_LOCATION);
if (ConfigUtils.shouldUseDefaultCliSqlLocation(sqlFolder, StringUtils.hasText(config.get(ConfigUtils.LOCATIONS)))) {
config.put(ConfigUtils.LOCATIONS, "filesystem:" + sqlFolder.getAbsolutePath());
}

if (commandLineArguments.isWorkingDirectorySet()) {
makeRelativeLocationsBasedOnWorkingDirectory(commandLineArguments.getWorkingDirectory(), config);
if (workingDirectory != null) {
makeRelativeLocationsBasedOnWorkingDirectory(workingDirectory, config);
}

ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ public class ModernConfigurationManager implements ConfigurationManager {
private static final String UNABLE_TO_PARSE_FIELD = "Unable to parse '%s' in your TOML configuration file";

public Configuration getConfiguration(CommandLineArguments commandLineArguments) {
String workingDirectory =
String installDirectory =
commandLineArguments.isWorkingDirectorySet() ? commandLineArguments.getWorkingDirectory()
: ClassUtils.getInstallDir(Main.class);
String workingDirectory = commandLineArguments.getWorkingDirectoryOrNull();

List<File> tomlFiles = ConfigUtils.getDefaultTomlConfigFileLocations(
new File(ClassUtils.getInstallDir(Main.class)), commandLineArguments.getWorkingDirectoryOrNull());
Expand Down Expand Up @@ -132,14 +133,14 @@ public Configuration getConfiguration(CommandLineArguments commandLineArguments)

}

File sqlFolder = new File(workingDirectory, DEFAULT_CLI_SQL_LOCATION);
File sqlFolder = new File(installDirectory, DEFAULT_CLI_SQL_LOCATION);
if (ConfigUtils.shouldUseDefaultCliSqlLocation(sqlFolder,
!config.getFlyway().getLocations().equals(ConfigurationModel.defaults().getFlyway().getLocations()))) {
config.getFlyway().setLocations(Arrays.stream(new String[]{"filesystem:" + sqlFolder.getAbsolutePath()}).collect(Collectors.toList()));
}

if (commandLineArguments.isWorkingDirectorySet()) {
makeRelativeLocationsBasedOnWorkingDirectory(commandLineArguments.getWorkingDirectory(),
if (workingDirectory != null) {
makeRelativeLocationsBasedOnWorkingDirectory(workingDirectory,
config.getFlyway().getLocations());
}

Expand All @@ -150,7 +151,7 @@ public Configuration getConfiguration(CommandLineArguments commandLineArguments)

configurePlugins(config, cfg);

loadJarDirsAndAddToClasspath(workingDirectory, cfg);
loadJarDirsAndAddToClasspath(installDirectory, cfg);

return cfg;
}
Expand Down Expand Up @@ -183,8 +184,14 @@ private void configurePlugins(ConfigurationModel config, ClassicConfiguration cf
.toList();

if (!missingParams.isEmpty()) {
throw new FlywayException(
"Failed to configure Parameters: " + String.join(", ", missingParams));

if (config.getRootConfigurations().isEmpty()) {

throw new FlywayException(
"Failed to configure Parameters: " + String.join(", ", missingParams));

}

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.flywaydb.core.api.output.CompositeResult;
import org.flywaydb.core.api.output.HtmlResult;
import org.flywaydb.core.api.output.OperationResult;
import org.flywaydb.core.internal.configuration.ConfigUtils;
import org.flywaydb.core.internal.configuration.models.FlywayModel;
import org.flywaydb.core.internal.reports.ReportDetails;
import org.flywaydb.core.internal.reports.json.CompositeResultDeserializer;
Expand Down Expand Up @@ -75,12 +76,15 @@ public static ReportDetails writeReport(Configuration configuration, OperationRe
String tmpJsonReportFilename = baseReportFilename + JSON_REPORT_EXTENSION;
String tmpHtmlReportFilename = baseReportFilename + (reportFilename.endsWith(HTM_REPORT_EXTENSION) ? HTM_REPORT_EXTENSION : HTML_REPORT_EXTENSION);

tmpJsonReportFilename = ConfigUtils.getFilenameWithWorkingDirectory(tmpJsonReportFilename, configuration);
tmpHtmlReportFilename = ConfigUtils.getFilenameWithWorkingDirectory(tmpHtmlReportFilename, configuration);

try {
htmlCompositeResult = JsonUtils.appendIfExists(tmpJsonReportFilename, htmlCompositeResult, new CompositeResultDeserializer(configuration.getPluginRegister()));
reportDetails.setJsonReportFilename(createJsonReport(htmlCompositeResult, tmpJsonReportFilename));
reportDetails.setHtmlReportFilename(createHtmlReport(configuration, htmlCompositeResult, tmpHtmlReportFilename));
} catch (FlywayException e) {
if (DEFAULT_REPORT_FILENAME.equals(configuration.getReportFilename())) {
if (DEFAULT_REPORT_FILENAME.equals(reportFilename)) {
LOG.warn("Unable to create default report files.");
if (LOG.isDebugEnabled()) {
e.printStackTrace(System.out);
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.9.1</version>
<version>10.10.0</version>
</parent>
<artifactId>flyway-core</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,15 @@ public void setEnvironment(String environment) {
}
}

public void setEnvironmentProvisionMode(ProvisionerMode provisionerMode) {
getModernFlyway().setEnvironmentProvisionMode(provisionerMode.toString());
}

public void setAllEnvironments(Map<String, EnvironmentModel> environments) {
getModernConfig().setEnvironments(environments);
resolvedEnvironments.clear();
}

/**
* Sets whether SQL should be executed within a transaction.
*
Expand Down

0 comments on commit 5511c69

Please sign in to comment.