添加新的迁移文件后,我试图flywayMigrate从我的项目中的 Gradle 运行任务,但 Flyway 没有接收到它。我得到这个输出:Flyway Community Edition 5.2.4 by BoxfuseDatabase: jdbc:postgresql://localhost:5432/mydb (PostgreSQL 10.6)Successfully validated 6 migrations (execution time 00:00.105s)Current version of schema "public": 5Schema "public" is up to date. No migration necessary.所以它检测到我有6 个迁移但它不执行我刚添加的新文件 ( V6) 并坚持说模式是最新的,即使它不是。这是我的配置的样子:{ url = database_url user = database_user password = database_password driver = database_driver schemas = ["public"] locations = ["filesystem:shared/src/main/resources/db/migration"] table = "flyway_schema_history" sqlMigrationPrefix = "V" sqlMigrationSuffix = ".sql" placeholderPrefix = "\${" placeholderSuffix = "}" target = "5.1"}我检查了每个设置,没问题,如果我删除所有表,它会选择前5 个迁移文件,但由于某种原因,第6个文件没有被选择。(我什至尝试添加第 7 个,但它也不起作用)我尝试sql在第 6 个迁移文件中运行它,它运行正常,因此 Flyway 可能存在问题。如果我使用debug标志运行,我可以看到它甚至解析并从文件中读出 sql,但所有迁移都被过滤掉了。我究竟做错了什么?
1 回答
眼眸繁星
TA贡献1873条经验 获得超9个赞
你有target = "5.1"你的配置,但是
target NO latest version
The target version up to which Flyway should run migrations.
Migrations with a higher version number will not be applied.
The string 'current' will be interpreted as MigrationVersion.CURRENT,
a placeholder for the latest version that has been applied to the database.
查看Gradle 任务:flywayMigrate
这就是为什么你不能处理迁移 > 5.1
添加回答
举报
0/150
提交
取消