Flyway (flyway)

flyway エンドポイントは、Flyway によって実行されるデータベース移行に関する情報を提供します。

移行の取得

移行を取得するには、次の curl ベースの例に示すように、GET リクエストを /actuator/flyway に作成します。

$ curl 'http://localhost: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" : [ {
            "type" : "SQL",
            "checksum" : -156244537,
            "version" : "1",
            "description" : "init",
            "script" : "V1__init.sql",
            "state" : "SUCCESS",
            "installedBy" : "SA",
            "installedOn" : "2024-06-20T09:57:46.714Z",
            "installedRank" : 1,
            "executionTime" : 5
          } ]
        }
      }
    }
  }
}

レスポンス構造

レスポンスには、アプリケーションの Flyway 移行の詳細が含まれます。次の表に、レスポンスの構造を示します。

パス タイプ 説明

contexts

Object

ID をキーとするアプリケーションコンテキスト

contexts.*.flywayBeans.*.migrations

Array

Flyway Bean 名をキーとする、Flyway インスタンスによって実行される移行。

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

Number

移行のチェックサム(ある場合)。

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

String

移行の説明(ある場合)。

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

Number

適用された移行のミリ秒単位の実行時間。

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

String

適用された移行をインストールしたユーザー(存在する場合)。

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

String

適用された移行がインストールされたときのタイムスタンプ(ある場合)。

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

Number

適用された移行のランク(ある場合)。後の移行のランクは高くなります。

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

String

移行の実行に使用されるスクリプトの名前(ある場合)。

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

String

移行の状態。(PENDINGABOVE_TARGETBELOW_BASELINEBASELINE_IGNOREDBASELINEIGNOREDMISSING_SUCCESSMISSING_FAILEDSUCCESSUNDONEAVAILABLEFAILEDOUT_OF_ORDERFUTURE_SUCCESSFUTURE_FAILEDOUTDATEDSUPERSEDEDDELETED)

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

String

移行の型。

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

String

移行を適用した後のデータベースのバージョン(ある場合)。

contexts.*.parentId

String

親アプリケーションコンテキストの ID(存在する場合)。