Skip to content

Commit

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

explicitly drop Oracle package bodies

reword log message around migration name validation
  • Loading branch information
rg-buildmonkey committed Jan 5, 2023
1 parent 71ab829 commit 953724b
Show file tree
Hide file tree
Showing 25 changed files with 99 additions and 22 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 43,11 @@ jobs:
- name: Checkout Flyway
uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'

- name: Build with Maven
run: mvn -B install -e --file pom.xml
3 changes: 2 additions & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 42,11 @@ jobs:
- name: Checkout Flyway
uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'

- name: Build with Maven
run: mvn -B install -e --file pom.xml "-Dgithub.os=${{ matrix.os }}"
Expand Down
9 changes: 9 additions & 0 deletions documentation/Flyway CLI and API/Commands/Clean.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 15,15 @@ Needless to say: **do not use against your production DB!**

- [SQL Server - no users will be dropped](Supported Databases/SQL Server#limitations)

## Cleaning additional objects
For complicated database structures an accurate dependency graph cannot always be constructed, so not every object is cleaned.
There are also objects that we do not drop as they aren’t always safe to, for example, users in SQL Server.
To clean additional objects, you can add an afterClean [callback](Concepts/Callback concept) defining drop statements. For example afterClean.sql:

```
DROP USER test_user
```

## Usage
See [configuration](Configuration/parameters/#clean) for clean specific configuration parameters.
{% include commandUsage.html command="Clean" %}
2 changes: 1 addition & 1 deletion documentation/Flyway CLI and API/Commands/Undo.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 13,7 @@ Undoes the most recently applied versioned migration.
{% include commandUsage.html command="Undo" %}
<br/>

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

```
<dependency>
Expand Down
12 changes: 12 additions & 0 deletions documentation/Flyway CLI and API/Concepts/Baseline Migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 11,18 @@ Instead, you might wish to add a single, cumulative migration that represents th

[Flyway Teams Edition](/https://flywaydb.org/download) gives you a way to achieve this using **Baseline Migrations**.

## Usage

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

```
<dependency>
<groupId>org.flywaydb.enterprise</groupId>
<artifactId>flyway-proprietary</artifactId>
<version>{{ site.flywayVersion }}</version>
</dependency>
```

## How it works

Baseline migrations are prefixed with `B` followed by the version of your database they represent. For example: `B5__my_database.sql` represents the state of your database after applying all versioned migrations up to and including `V5`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 46,9 @@ rules = ["(?i)(^|\\s)TO\\s DO($|\\s|;)"]
passOnRegexMatch = false
description = "Phrase 'to do' remains in the code"
```
### Good practice
### Good to know
* Does case sensitivity matter to you ? If it doesn't then make the regex rules insensitive too with the prefix `(?i)`
* You will need to use the [Java dialect](https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html) of regex

## File Naming
The file name will be used as the source of rule metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 55,16 @@ Cleaned database schema 'PUBLIC' (execution time 00:00.014s)</pre>
"warnings": [],
"operation": "clean"
}</pre>

## Limitations

- [SQL Server - no users will be dropped](Supported Databases/SQL Server#limitations)

## Cleaning additional objects
For complicated database structures an accurate dependency graph cannot always be constructed, so not every object is cleaned.
There are also objects that we do not drop as they aren’t always safe to, for example, users in SQL Server.
To clean additional objects, you can add an afterClean [callback](Concepts/Callback concept) defining drop statements. For example afterClean.sql:

```
DROP USER test_user
```
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 18,27 @@
<div class="col-md-9">

<div class="release">
<h2 id="9.11.0">Flyway 9.11.0 (2023-01-05)</h2>

<h3>Bug fixes</h3>
<ul>
<li>Explicitly drop Oracle package bodies so that package bodies not tied to an existing package are also cleaned</li>
</ul>

<h3>Changes</h3>
<ul>
<li>'check' reports now produce all successful reports and fail on the first non-successful report</li>
<li>Update RGCompare engine to 1.6.0.7325</li>
</ul>

<h3>New features</h3>
<ul>
<li>Regex Rule code analysis results now include the line and column number of where violations occurred</li>
</ul>

</div>

<div class="release">
<h2 id="9.10.2">Flyway 9.10.2 (2022-12-22)</h2>

<h3>Bug fixes</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: 9.10.2
flywayVersion: 9.11.0
enterpriseUrl: https://download.red-gate.com/maven/release/org/flywaydb/enterprise
kramdown:
smart_quotes: ["apos", "apos", "quot", "quot"]
Expand Down
4 changes: 2 additions & 2 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>9.10.2</version>
<version>9.11.0</version>
</parent>
<artifactId>flyway-commandline</artifactId>
<packaging>jar</packaging>
Expand All @@ -31,7 31,7 @@


<flyway-gcp-bigquery.version>${project.version}</flyway-gcp-bigquery.version>
<flyway-gcp-spanner.version>9.10.2-beta</flyway-gcp-spanner.version>
<flyway-gcp-spanner.version>9.11.0-beta</flyway-gcp-spanner.version>
<flyway-sqlserver.version>${project.version}</flyway-sqlserver.version>
<flyway-mysql.version>${project.version}</flyway-mysql.version>
<flyway-firebird.version>${project.version}</flyway-firebird.version>
Expand Down
2 changes: 1 addition & 1 deletion flyway-community-db-support/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>9.10.2</version>
<version>9.11.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

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>9.10.2</version>
<version>9.11.0</version>
</parent>
<artifactId>flyway-core</artifactId>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 38,7 @@ public static ConfigurationModel loadConfigurationFromEnvironment() {
Map<String, String> environmentVariables = System.getenv()
.entrySet()
.stream()
.filter(e -> e.getKey().startsWith("flyway_") || e.getKey().startsWith("environment_"))
.filter(e -> e.getKey().startsWith("flyway_") || e.getKey().startsWith("environments_"))
.collect(Collectors.toMap(k -> k.getKey().replace("_", "."), Map.Entry::getValue));
return toConfiguration(unflattenMap(environmentVariables));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 140,7 @@ protected void doClean() throws SQLException {
FUNCTION,
PROCEDURE,
PACKAGE,
PACKAGE_BODY,
CONTEXT,
LIBRARY,
TYPE,
Expand Down Expand Up @@ -433,6 434,7 @@ public List<String> getObjectNames(JdbcTemplate jdbcTemplate, OracleDatabase dat
PROCEDURE("PROCEDURE"),
FUNCTION("FUNCTION"),
PACKAGE("PACKAGE"),
PACKAGE_BODY("PACKAGE BODY"),

// Contexts, seen in DBA_CONTEXT view, may remain if DBA_CONTEXT is not accessible.
CONTEXT("CONTEXT") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 59,7 @@ public void validateSQLMigrationNaming(ResourceProvider provider, Configuration
throw new FlywayException("Invalid SQL filenames found:\r\n" StringUtils.collectionToDelimitedString(errorsFound, "\r\n"));
} else {
LOG.info(errorsFound.size() " SQL migrations were detected but not run because they did not follow the filename convention.");
LOG.info("If this is in error, enable debug logging or 'validateMigrationNaming' to fail fast and see a list of the invalid file names.");
LOG.info("If this is in error, set 'validateMigrationNaming' to true to fail fast and see a list of the invalid file names.");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,4 432,14 @@ public static Pair<String, String> splitAtFirstSeparator(String input, String se
return Pair.of(input, "");
}
}

public static int countOccurrencesOf(String text, char search) {
int count = 0;
for (char c : text.toCharArray()) {
if (c == search) {
count ;
}
}
return count;
}
}
2 changes: 1 addition & 1 deletion flyway-firebird/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 22,7 @@
<parent>
<artifactId>flyway-parent</artifactId>
<groupId>org.flywaydb</groupId>
<version>9.10.2</version>
<version>9.11.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions flyway-gcp-bigquery/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 21,14 @@
<parent>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-parent</artifactId>
<version>9.10.2</version>
<version>9.11.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>flyway-gcp-bigquery</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<version>9.10.2</version>
<version>9.11.0</version>

<dependencies>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions flyway-gcp-spanner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 21,14 @@
<parent>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-parent</artifactId>
<version>9.10.2</version>
<version>9.11.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>flyway-gcp-spanner</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<version>9.10.2-beta</version>
<version>9.11.0-beta</version>

<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion flyway-gradle-plugin/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>9.10.2</version>
<version>9.11.0</version>
</parent>
<artifactId>flyway-gradle-plugin</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion flyway-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 20,7 @@
<parent>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-parent</artifactId>
<version>9.10.2</version>
<version>9.11.0</version>
</parent>
<artifactId>flyway-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
Expand Down
2 changes: 1 addition & 1 deletion flyway-mysql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 22,7 @@
<parent>
<artifactId>flyway-parent</artifactId>
<groupId>org.flywaydb</groupId>
<version>9.10.2</version>
<version>9.11.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion flyway-singlestore/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>9.10.2</version>
<version>9.11.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion flyway-sqlserver/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>9.10.2</version>
<version>9.11.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 30,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-parent</artifactId>
<version>9.10.2</version>
<version>9.11.0</version>
<packaging>pom</packaging>
<name>${project.artifactId}</name>
<description>Flyway: Database Migrations Made Easy.</description>
Expand Down Expand Up @@ -160,6 160,7 @@
<version.jna>4.5.2</version.jna>
<version.jtds>1.3.1</version.jtds>
<version.junit>5.9.0</version.junit>
<version.junit-pioneer>1.9.1</version.junit-pioneer>
<version.log4net2>2.17.1</version.log4net2>
<version.logback>1.2.3</version.logback>
<version.lombok>1.18.20</version.lombok>
Expand Down Expand Up @@ -340,6 341,12 @@
<version>${version.testcontainers}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.junit-pioneer</groupId>
<artifactId>junit-pioneer</artifactId>
<version>${version.junit-pioneer}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
Expand Down

0 comments on commit 953724b

Please sign in to comment.