Skip to content

Commit

Permalink
Merge branch 'main' into clickhouse-support
Browse files Browse the repository at this point in the history
# Conflicts:
#	flyway-community-db-support/pom.xml
#	flyway-community-db-support/src/main/resources/META-INF/services/org.flywaydb.core.extensibility.Plugin
  • Loading branch information
sazonov committed Nov 1, 2023
2 parents d9cbe15 + a7ce51e commit c7f4690
Show file tree
Hide file tree
Showing 557 changed files with 8,304 additions and 4,185 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ jobs:
- macOS-latest
- windows-latest
java:
- 8
- 11
- 17
fail-fast: false

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ jobs:
- macOS-latest
- windows-latest
java:
- 8
- 11
- 17

permissions:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile_tests
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:17-jre-focal as flyway
FROM eclipse-temurin:17-jdk-focal as flyway
RUN apt-get update \
&& apt-get install -y python3-pip \
&& pip3 install sqlfluff==1.2.1
Expand Down
135 changes: 69 additions & 66 deletions LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,72 +1,74 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
==============

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
_Version 2.0, January 2004_
_&lt;<http://www.apache.org/licenses/>&gt;_

1. Definitions.
### Terms and Conditions for use, reproduction, and distribution

"License" shall mean the terms and conditions for use, reproduction, and
#### 1. Definitions

“License” shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by the copyright
Licensor shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all other entities
Legal Entity shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, "control" means (i) the power, direct or
For the purposes of this definition, control means **(i)** the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
outstanding shares, or **(iii)** beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity exercising
You (or Your) shall mean an individual or Legal Entity exercising
permissions granted by this License.

"Source" form shall mean the preferred form for making modifications, including
Source form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.

"Object" form shall mean any form resulting from mechanical transformation or
Object form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or Object form, made
Work shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object form, that
Derivative Works shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including the original version
Contribution shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
"submitted" means any form of electronic, verbal, or written communication sent
submitted means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as "Not a Contribution."
owner as Not a Contribution.

"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
Contributor shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.

2. Grant of Copyright License.
#### 2. Grant of Copyright License

Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.

3. Grant of Patent License.
#### 3. Grant of Patent License

Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
Expand All @@ -81,40 +83,41 @@ Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.

4. Redistribution.
#### 4. Redistribution

You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:

You must give any other recipients of the Work or Derivative Works a copy of
this License; and
You must cause any modified files to carry prominent notices stating that You
changed the files; and
You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
If the Work includes a "NOTICE" text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
* **(a)** You must give any other recipients of the Work or Derivative Works a copy of
this License; and
* **(b)** You must cause any modified files to carry prominent notices stating that You
changed the files; and
* **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.

You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.

5. Submission of Contributions.
#### 5. Submission of Contributions

Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
Expand All @@ -123,25 +126,25 @@ Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.

6. Trademarks.
#### 6. Trademarks

This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.

7. Disclaimer of Warranty.
#### 7. Disclaimer of Warranty

Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
Work (and each Contributor provides its Contributions) on an AS IS BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.

8. Limitation of Liability.
#### 8. Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
Expand All @@ -153,7 +156,7 @@ damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability.
#### 9. Accepting Warranty or Additional Liability

While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
Expand All @@ -164,28 +167,28 @@ agree to indemnify, defend, and hold each Contributor harmless for any liability
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_

APPENDIX: How to apply the Apache License to your work
### APPENDIX: How to apply the Apache License to your work

To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets "[]" replaced with your own
notice, with the fields enclosed by brackets `[]` replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same "printed page" as the copyright notice for easier identification within
the same printed page as the copyright notice for easier identification within
third-party archives.

Copyright © Red Gate Software Ltd 2010-2022

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.
Copyright © Red Gate Software Ltd 2010-2023
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.
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Here is the info on how you can contribute in various ways to the project: https

License
-------
Copyright © Red Gate Software Ltd 2010-2022
Copyright © Red Gate Software Ltd 2010-2023

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ For example, to access Flyway {{ page.flywayVersion }}:
<tr>
<th>Gradle</th>
<td>
<pre class="prettyprint">compile "org.flywaydb:flyway-core:{{ page.flywayVersion }}"</pre>
<pre class="prettyprint">implementation "org.flywaydb:flyway-core:{{ page.flywayVersion }}"</pre>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -112,7 +112,7 @@ For example, to access Flyway {{ page.flywayVersion }}:
}

dependencies {
compile "org.flywaydb<strong>.pro</strong>:flyway-core:{{ page.flywayVersion }}"
implementation "org.flywaydb<strong>.pro</strong>:flyway-core:{{ page.flywayVersion }}"
}</pre>
</td>
</tr>
Expand Down Expand Up @@ -183,7 +183,7 @@ dependencies {
}

dependencies {
compile "org.flywaydb<strong>.enterprise</strong>:flyway-core:{{ page.flywayVersion }}"
implementation "org.flywaydb<strong>.enterprise</strong>:flyway-core:{{ page.flywayVersion }}"
}</pre>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ When using the CLI, you can add to the classpath by dropping the `.jar` files fo
<i class="fa fa-file-text"></i> README.txt
</pre>

You can also specify more folders to load jars from using the [jarDirs](Configuration/Parameters/Jar Dirs) configuration parameter.
You can also specify more folders to load jars from using the [jarDirs](Configuration/Parameters/Flyway/Jar Dirs) configuration parameter.

### API

Expand Down
64 changes: 64 additions & 0 deletions documentation/Flyway CLI and API/Commands/Auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
subtitle: Auth
---
# Auth

`auth` initiates an online or offline license acquisition flow that can be used instead of the legacy [license key](Configuration/Parameters/Flyway/License Key) workflow.

If `auth` is run on a machine that is connected to the internet with an accessible browser, Flyway will launch a web browser prompting the user to log in with their Redgate account
username and password. Please note that `auth` is not supported on WSL, nor when using SSH. For these cases and any where a web browser is inaccessible on the same machine that is
running Flyway, it is recommended to use environment variables (described below) to authorize Flyway.

Upon successful login, a license permit is then saved to disk in the `Flyway CLI` directory of the Redgate app data folder. If the user is offline, a
[link to create a license permit](https://permits.red-gate.com/offline?productCode=64&constraint=asdf) will be printed to the console. The user can then copy the license permit
from that site and paste it into the console to authorize Flyway.

#### App Data Folder Locations

###### Windows

You can find the `Flyway CLI` directory here: `%APPDATA%\Redgate\Flyway CLI`.

###### MacOS & Linux

You can find the `Flyway CLI` directory here: `~/.config/Redgate/Flyway CLI`.

#### Flags:

| Parameter | Edition | Description
|------------------|--------------------| -----------------------------------------------------
| -IAgreeToTheEula | All | Mandatory for `auth` to run
| -logout | All | Logs a user out of their authorized session of Flyway


#### Environment Variables

Users can specify license permits using environment variables that Flyway recognizes without needing to run the `auth` command:

- `REDGATE_LICENSING_PERMIT_PATH`: Specifies a custom path to a license permit file. Users can save a license permit in a text file to an arbitrary location on disk and use this
environment variable to point Flyway to the full path of the license permit file in order to authorize Flyway.
- `REDGATE_LICENSING_PERMIT`: Specifies a license permit as a string. Users can save a license permit as raw text as a value to this environment variable to authorize Flyway.

#### Authorization Precedence

There are multiple ways to authorize Flyway. The following list shows the order of precedence for authorization:

1. `REDGATE_LICENSING_PERMIT_PATH` environment variable
2. `REDGATE_LICENSING_PERMIT` environment variable
3. License permit located in the `Flyway CLI` directory of the Redgate app data folder, saved to disk by running the `auth` command (both the online and offline flow save the
license permit to the same location)
4. [License key](Configuration/Parameters/License Key)

#### Refresh Tokens

When `auth` is run successfully, an refresh token is saved to disk in the `Flyway CLI` directory of the Redgate app data folder. This refresh token is used to
automatically refresh a user's license permit when it expires. Each time a license permit is refreshed, a new refresh token is saved to disk, replacing the existing
refresh token. This only applies to expired license permits in the `Flyway CLI` directory of the Redgate app data folder—Flyway will not automatically refresh expired license
permits specified by environment variables.

#### Logout

`auth -logout` can be run to log out of an authorized session of Flyway. Under the hood, logging out simply deletes the license permit and refresh token stored on disk in the
Redgate app data folder. Assuming no other methods of authorization are is use (such as a permit environment variable or legacy license key environment variable), the user will be
logged out of their session and Flyway will run as Community Edition. If a valid permit environment variable or legacy license key environment variable is set, Flyway will still
honor these as authorizations and logout will not remove them.
2 changes: 1 addition & 1 deletion documentation/Flyway CLI and API/Commands/Baseline.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ When you have many migrations, it might be desirable to reset your baseline migr
Learn more about the concept of [Baseline Migrations](Concepts/Baseline Migrations) and a [Baseline Migration tutorial](Tutorials/Tutorial Baseline Migrations)

## Usage
See [configuration](Configuration/parameters/#baseline) for baseline specific configuration parameters.
See [configuration](Configuration/parameters/flyway/#baseline) for baseline specific configuration parameters.
{% include commandUsage.html command="Baseline" %}
Loading

0 comments on commit c7f4690

Please sign in to comment.