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.