【发布时间】:2020-09-13 02:28:48
【问题描述】:
我正在从 gradle 4 升级到 6。 这迫使我升级了很多东西,比如 spring、h2、mySql 连接器等。
现在我遇到了这个问题: 在运行时,使用 MySQL 一切正常。 但在测试中,我得到:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flyway' defined in com.bluerbn.wallet.infra.SpringTestConfiguration: Invocation of init method failed; nested exception is org.flywaydb.core.internal.command.DbMigrate$FlywayMigrateException:
Migration V9__fixIndex.sql failed
------------------------------------------------
SQL State : 42S22
Error Code : 42122
Message : Column "INDEX" not found; SQL statement:
ALTER TABLE table1 DROP INDEX ACC_INDEX [42122-200]
Location : db/migration/V9__fixIndex.sql (/Users/.../resources/db/migration/V9__fixIndex.sql)
Line : 1
Statement : ALTER TABLE table1 DROP INDEX ACC_INDEX
这是升级前运行良好的旧脚本。
版本:
- 弹簧靴:2.3.0
- org.flywaydb:flyway-core:6.4.1(虽然在gradle中我放了6.4.2)
- com.h2database:h2:1.4.200
- mysql:mysql-connector-java:8.0.18
有什么想法吗?
【问题讨论】:
标签: spring-boot h2 flyway