Liquibase (liquibase)

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

获取变更

要获取变更,向 /actuator/liquibase 发送 GET 请求,如下面的基于 curl 的示例所示:

$ 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-25T10:03:14.238Z",
            "deploymentId" : "8167394080",
            "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.