添加新的遷移文件后,我試圖flywayMigrate從我的項(xiàng)目中的 Gradle 運(yùn)行任務(wù),但 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 個遷移但它不執(zhí)行我剛添加的新文件 ( V6) 并堅(jiān)持說模式是最新的,即使它不是。這是我的配置的樣子:{ 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"}我檢查了每個設(shè)置,沒問題,如果我刪除所有表,它會選擇前5 個遷移文件,但由于某種原因,第6個文件沒有被選擇。(我什至嘗試添加第 7 個,但它也不起作用)我嘗試sql在第 6 個遷移文件中運(yùn)行它,它運(yùn)行正常,因此 Flyway 可能存在問題。如果我使用debug標(biāo)志運(yùn)行,我可以看到它甚至解析并從文件中讀出 sql,但所有遷移都被過濾掉了。我究竟做錯了什么?
Flyway 無法檢測到新的遷移文件
叮當(dāng)貓咪
2022-12-28 14:28:17