Liquibase (liquibase)

liquibase 端点提供由 Liquibase 应用到数据库的变更集信息。

获取变更集

要获取变更集,请对 /actuator/liquibase 发起 GET 请求,示例如下:

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

响应结果类似如下:

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

{
  "contexts" : {
    "application" : {
      "liquibaseBeans" : {
        "liquibase" : {
          "changeSets" : [ {
            "author" : "marceloverdijk",
            "changeLog" : "org/springframework/boot/actuate/autoconfigure/liquibase/db.changelog-master.yaml",
            "comments" : "",
            "contexts" : [ ],
            "dateExecuted" : "2025-05-26T03:08:23.486Z",
            "deploymentId" : "8228872918",
            "description" : "createTable tableName=customer",
            "execType" : "EXECUTED",
            "id" : "1",
            "labels" : [ ],
            "checksum" : "9:d3589feb2baad02e15540750499ba311",
            "orderExecuted" : 1
          } ]
        }
      }
    }
  }
}

响应结构

响应内容包含应用的 Liquibase 变更集详情。 下表描述了响应结构:

Path Type Description

contexts

Object

Application contexts keyed by id

contexts.*.liquibaseBeans.*.changeSets

Array

Change sets made by the Liquibase beans, keyed by bean name.

contexts.*.liquibaseBeans.*.changeSets[].author

String

Author of the change set.

contexts.*.liquibaseBeans.*.changeSets[].changeLog

String

Change log that contains the change set.

contexts.*.liquibaseBeans.*.changeSets[].comments

String

Comments on the change set.

contexts.*.liquibaseBeans.*.changeSets[].contexts

Array

Contexts of the change set.

contexts.*.liquibaseBeans.*.changeSets[].dateExecuted

String

Timestamp of when the change set was executed.

contexts.*.liquibaseBeans.*.changeSets[].deploymentId

String

ID of the deployment that ran the change set.

contexts.*.liquibaseBeans.*.changeSets[].description

String

Description of the change set.

contexts.*.liquibaseBeans.*.changeSets[].execType

String

Execution type of the change set (EXECUTED, FAILED, SKIPPED, RERAN, MARK_RAN).

contexts.*.liquibaseBeans.*.changeSets[].id

String

ID of the change set.

contexts.*.liquibaseBeans.*.changeSets[].labels

Array

Labels associated with the change set.

contexts.*.liquibaseBeans.*.changeSets[].checksum

String

Checksum of the change set.

contexts.*.liquibaseBeans.*.changeSets[].orderExecuted

Number

Order of the execution of the change set.

contexts.*.liquibaseBeans.*.changeSets[].tag

String

Tag associated with the change set, if any.

contexts.*.parentId

String

Id of the parent application context, if any.