此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Boot 3.3.1Spring中文文档

此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Boot 3.3.1Spring中文文档

端点提供有关 Flyway 执行的数据库迁移的信息。flywaySpring中文文档

检索迁移

若要检索迁移,请向 发出请求,如以下基于 curl 的示例所示:GET/actuator/flywaySpring中文文档

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

生成的响应类似于以下内容:Spring中文文档

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

{
  "contexts" : {
    "application" : {
      "flywayBeans" : {
        "flyway" : {
          "migrations" : [ {
            "type" : "SQL",
            "checksum" : -156244537,
            "version" : "1",
            "description" : "init",
            "script" : "V1__init.sql",
            "state" : "SUCCESS",
            "installedBy" : "SA",
            "installedOn" : "2024-06-20T18:36:24.723Z",
            "installedRank" : 1,
            "executionTime" : 8
          } ]
        }
      }
    }
  }
}

响应结构

响应包含应用程序的 Flyway 迁移的详细信息。 下表描述了响应的结构:Spring中文文档

路径 类型 描述

contextsSpring中文文档

ObjectSpring中文文档

按 id 键控的应用程序上下文Spring中文文档

contexts.*.flywayBeans.*.migrationsSpring中文文档

ArraySpring中文文档

由 Flyway 实例执行的迁移,按 Flyway Bean 名称键控。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].checksumSpring中文文档

NumberSpring中文文档

迁移的校验和(如果有)。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].descriptionSpring中文文档

StringSpring中文文档

迁移的说明(如果有)。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].executionTimeSpring中文文档

NumberSpring中文文档

应用迁移的执行时间(以毫秒为单位)。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].installedBySpring中文文档

StringSpring中文文档

安装了应用的迁移的用户(如果有)。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].installedOnSpring中文文档

StringSpring中文文档

安装应用的迁移的时间戳(如果有)。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].installedRankSpring中文文档

NumberSpring中文文档

应用的迁移的排名(如果有)。后来的迁移具有更高的等级。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].scriptSpring中文文档

StringSpring中文文档

用于执行迁移的脚本的名称(如果有)。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].stateSpring中文文档

StringSpring中文文档

迁移的状态。(, , , , , , , , , , , , , , , , ,PENDINGABOVE_TARGETBELOW_BASELINEBASELINE_IGNOREDBASELINEIGNOREDMISSING_SUCCESSMISSING_FAILEDSUCCESSUNDONEAVAILABLEFAILEDOUT_OF_ORDERFUTURE_SUCCESSFUTURE_FAILEDOUTDATEDSUPERSEDEDDELETED)Spring中文文档

contexts.*.flywayBeans.*.migrations.[].typeSpring中文文档

StringSpring中文文档

迁移的类型。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].versionSpring中文文档

StringSpring中文文档

应用迁移后的数据库版本(如果有)。Spring中文文档

contexts.*.parentIdSpring中文文档

StringSpring中文文档

父应用程序上下文的 ID(如果有)。Spring中文文档

路径 类型 描述

contextsSpring中文文档

ObjectSpring中文文档

按 id 键控的应用程序上下文Spring中文文档

contexts.*.flywayBeans.*.migrationsSpring中文文档

ArraySpring中文文档

由 Flyway 实例执行的迁移,按 Flyway Bean 名称键控。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].checksumSpring中文文档

NumberSpring中文文档

迁移的校验和(如果有)。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].descriptionSpring中文文档

StringSpring中文文档

迁移的说明(如果有)。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].executionTimeSpring中文文档

NumberSpring中文文档

应用迁移的执行时间(以毫秒为单位)。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].installedBySpring中文文档

StringSpring中文文档

安装了应用的迁移的用户(如果有)。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].installedOnSpring中文文档

StringSpring中文文档

安装应用的迁移的时间戳(如果有)。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].installedRankSpring中文文档

NumberSpring中文文档

应用的迁移的排名(如果有)。后来的迁移具有更高的等级。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].scriptSpring中文文档

StringSpring中文文档

用于执行迁移的脚本的名称(如果有)。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].stateSpring中文文档

StringSpring中文文档

迁移的状态。(, , , , , , , , , , , , , , , , ,PENDINGABOVE_TARGETBELOW_BASELINEBASELINE_IGNOREDBASELINEIGNOREDMISSING_SUCCESSMISSING_FAILEDSUCCESSUNDONEAVAILABLEFAILEDOUT_OF_ORDERFUTURE_SUCCESSFUTURE_FAILEDOUTDATEDSUPERSEDEDDELETED)Spring中文文档

contexts.*.flywayBeans.*.migrations.[].typeSpring中文文档

StringSpring中文文档

迁移的类型。Spring中文文档

contexts.*.flywayBeans.*.migrations.[].versionSpring中文文档

StringSpring中文文档

应用迁移后的数据库版本(如果有)。Spring中文文档

contexts.*.parentIdSpring中文文档

StringSpring中文文档

父应用程序上下文的 ID(如果有)。Spring中文文档