LoginSignup
1
0

More than 1 year has passed since last update.

【Java】Caused by: org.flywaydb.core.internal.license.FlywayEditionUpgradeRequiredExceptionの対処方法

Last updated at Posted at 2022-05-11

参考

事象

MySQL(v5.7)に対して、Flyway(v8.5.10)でマイグレーション実行したら下記のエラーが発生。

Caused by: org.flywaydb.core.internal.license.FlywayEditionUpgradeRequiredException: 
Flyway Teams Edition or MySQL upgrade required: 
MySQL 5.7 is no longer supported by Flyway Community Edition, but still supported by Flyway Teams Edition.

Flywayの依存

<dependency>
   <groupId>org.flywaydb</groupId>
   <artifactId>flyway-core</artifactId>
   <version>8.5.10</version>
</dependency>
<dependency>
   <groupId>org.flywaydb</groupId>
   <artifactId>flyway-mysql</artifactId>
   <version>8.5.10</version>
</dependency>

原因

【7.15.0】より新しいバージョンのFlyway Teams Editionは、【8.0】以上のMySQLしか受け入れないため。

今回の状況だと

 Flyway【8.5.10】 ← このバージョンのFlywayが受け入れるMySQLのバージョンは最低でも8.0以上じゃないとダメ。
 MySQL【5.7】

対処方法

2つ対処方法がある。

 Flyway【8.5.10】 ← こいつが7.15.0以下だったら問題ない。
 MySQL【5.7】  ← こいつが8.0以上だったら問題ない

対処方法① Flywayのバージョンを【7.15.0】以下にする。
対処方法② MySQLのバージョンを【8.0】以上にする。

どちらかのバージョンを変えればOK。私が出くわした環境だと、MySQLのバージョンは変えられない状況であったため、Flywayのバージョンを↓のように【7.15.0】に変更することで対処した。flyway-mysqlは、7.15.0より新しいFlywayで必要になる依存のようなので、取り除く。

<dependency>
   <groupId>org.flywaydb</groupId>
   <artifactId>flyway-core</artifactId>
   <version>7.15.0</version>
</dependency>
<!-- 不要なので削除する -->
<!-- <dependency>
   <groupId>org.flywaydb</groupId>
   <artifactId>flyway-mysql</artifactId>
   <version>8.5.10</version>
</dependency>
--!>

余談

MySQLのバージョン

正直MySQLのバージョンなんて今まで1度も気にしてなかったよね(´・ω・)

✅メジャーバージョンは【5.6】【5.7】【8.0】 ※現時点(2022/05/11)

✅AWS RDSインスタンスでは、2022年2月時点で【5.6】は非推奨化されている。

image.png

Flywayは2つのEdition(Teams Edition/Community Edition)がある。

Flyway Community Edition(今回使っている方)

<dependency>
   <groupId>org.flywaydb</groupId>
   <artifactId>flyway-core</artifactId>
   <version>7.15.0</version>
</dependency>

Flyway Teams Edition(Enterprise)

<dependency>
   <groupId>org.flywaydb.enterprise</groupId>
   <artifactId>flyway-core</artifactId>
   <version>7.15.0</version>
</dependency>

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0