【发布时间】:2018-11-01 21:31:14
【问题描述】:
我正在尝试将 Flyway 与我的简单 maven 项目集成以用于学习目的。
我正在使用以下插件和配置:
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>4.0.3</version>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.9</version>
</dependency>
</dependencies>
<configuration>
<url>jdbc:mysql://${database.host}:${database.port}/${database.schema}?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8</url>
<user>${database.user}</user>
<password>${database.password}</password>
<sqlMigrationPrefix>V_</sqlMigrationPrefix>
<sqlMigrationSeparator>__</sqlMigrationSeparator>
<locations>
<location>filesystem:src/main/resources/db/migrations</location>
</locations>
</configuration>
</plugin>
这是我的示例迁移 sql 的名称:
V_1__create_new_table.sql
我不确定我做错了什么,但我不断收到以下异常:
org.flywaydb.core.api.FlywayException: Invalid version containing non-numeric characters. Only 0..9 and . are allowed. Invalid version: V.1
我确实参考了以下问题,正如您在配置中看到的那样,我已经完成了所要求的操作: Similar Question
【问题讨论】: