亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Flyway 無法檢測到新的遷移文件

Flyway 無法檢測到新的遷移文件

叮當貓咪 2022-12-28 14:28:17
添加新的遷移文件后,我試圖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


查看完整回答
反對 回復 2022-12-28
  • 1 回答
  • 0 關注
  • 321 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號