Flyway (flyway)

flyway 端點提供有關 Flyway 執行的資料庫遷移資訊。

檢索遷移

要檢索遷移,請向 /actuator/flyway 發出 GET 請求,如以下基於 curl 的示例所示:

$ curl 'https://:8080/actuator/flyway' -i -X GET

結果響應類似於以下內容

HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 515

{
  "contexts" : {
    "application" : {
      "flywayBeans" : {
        "flyway" : {
          "migrations" : [ {
            "checksum" : -156244537,
            "description" : "init",
            "executionTime" : 6,
            "installedBy" : "SA",
            "installedOn" : "2025-11-20T16:33:46.151Z",
            "installedRank" : 1,
            "script" : "V1__init.sql",
            "state" : "SUCCESS",
            "type" : "SQL",
            "version" : "1"
          } ]
        }
      }
    }
  }
}

響應結構

響應包含應用程式 Flyway 遷移的詳細資訊。下表描述了響應的結構:

路徑 型別 描述

contexts

物件

按 ID 鍵控的應用程式上下文

contexts.*.flywayBeans.*.migrations

陣列

由 Flyway 例項執行的遷移,按 Flyway bean 名稱鍵控。

contexts.*.flywayBeans.*.migrations.[].checksum

數字

遷移的校驗和(如果有)。

contexts.*.flywayBeans.*.migrations.[].description

字串

遷移的描述(如果有)。

contexts.*.flywayBeans.*.migrations.[].executionTime

數字

已應用遷移的執行時間(毫秒)。

contexts.*.flywayBeans.*.migrations.[].installedBy

字串

安裝已應用遷移的使用者(如果有)。

contexts.*.flywayBeans.*.migrations.[].installedOn

字串

已應用遷移的安裝時間戳(如果有)。

contexts.*.flywayBeans.*.migrations.[].installedRank

數字

已應用遷移的排名(如果有)。後續遷移具有更高的排名。

contexts.*.flywayBeans.*.migrations.[].script

字串

用於執行遷移的指令碼名稱(如果有)。

contexts.*.flywayBeans.*.migrations.[].state

字串

遷移狀態。(PENDING, ABOVE_TARGET, BELOW_BASELINE, BASELINE_IGNORED, BASELINE, IGNORED, MISSING_SUCCESS, MISSING_FAILED, SUCCESS, UNDONE, AVAILABLE, FAILED, OUT_OF_ORDER, FUTURE_SUCCESS, FUTURE_FAILED, OUTDATED, SUPERSEDED, DELETED)

contexts.*.flywayBeans.*.migrations.[].type

字串

遷移型別。

contexts.*.flywayBeans.*.migrations.[].version

字串

應用遷移後資料庫的版本(如果有)。

contexts.*.parentId

字串

父應用程式上下文的 ID(如果有)。

© . This site is unofficial and not affiliated with VMware.