Skip to content

SQLite Migration Application 0.1.0

一つのデータベースに、指定したマイグレーションセットを適用します。

公開パッケージの内容を取得して検証済みです。

Hostの対応や受け入れ判断は、パッケージの公開とは別です。このバージョンを使う前に、利用先のHostで確認してください。

使い方

未適用の末尾部分だけを実行します。この適用リソースを削除しても、downマイグレーションの実行やデータベースの適用履歴の書き換えは行いません。

関連するForms: SQLiteDatabase 0.1.0 · SQLiteMigrationSet 0.1.0

定義の説明(英語原文)

Applies one exact SQLite Migration Set to one exact SQLite Database. Both relations are immutable and UID-pinned before mutation. The database's durable migration ledger records each applied manifest entry as its ordered path+digest pair. The requested set must extend that ledger exactly; a rewrite, reorder, or removal is refused before SQL executes, and only the unapplied suffix runs. Each file and its ledger append commit atomically, so an interrupted application retries the same suffix without replaying a recorded migration. Ready means the ledger equals the referenced set. Deleting this attachment only stops managing the application resource: it never runs down-migrations, rewrites the ledger, reverts schema, or deletes the database.

設定項目

項目名とスキーマ内の説明は、パッケージに含まれる英語の原文です。日本語の解説は定義に要件を追加するものではありません。

database

必須 · object

Exact SQLite Database whose durable migration ledger and schema this application advances.

  • additionalProperties: false

migrationSet

必須 · object

Exact immutable SQLite Migration Set whose ordered manifest must extend the database ledger.

  • additionalProperties: false

設定の例

パッケージに含まれるfixtures/desired.jsonをそのまま掲載しています。完全なHost APIリクエストやOpenTofuの設定ではありません。例のリソース参照とArtifactのダイジェストは、実際の値に置き換えてください。このJSONだけでリソースが作成されることはありません。

json
{
  "database": {
    "apiVersion": "edge.forms.takoform.com",
    "kind": "SQLiteDatabase",
    "name": "sqlite-database"
  },
  "migrationSet": {
    "apiVersion": "edge.forms.takoform.com",
    "kind": "SQLiteMigrationSet",
    "name": "sqlite-migration-set"
  }
}

例の原文を見る

設定のスキーマ全文(英語原文)

入れ子の項目、選択肢、すべてのスキーマ制約を以下に掲載しています。Hostが検証する意味上の規則は、定義の説明にも記載されています。

json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Applies one exact SQLite Migration Set to one exact SQLite Database. Both relations are immutable and UID-pinned before mutation. The database's durable migration ledger records each applied manifest entry as its ordered path+digest pair. The requested set must extend that ledger exactly; a rewrite, reorder, or removal is refused before SQL executes, and only the unapplied suffix runs. Each file and its ledger append commit atomically, so an interrupted application retries the same suffix without replaying a recorded migration. Ready means the ledger equals the referenced set. Deleting this attachment only stops managing the application resource: it never runs down-migrations, rewrites the ledger, reverts schema, or deletes the database.",
  "properties": {
    "database": {
      "additionalProperties": false,
      "description": "Exact SQLite Database whose durable migration ledger and schema this application advances.",
      "properties": {
        "apiVersion": {
          "const": "edge.forms.takoform.com",
          "type": "string"
        },
        "kind": {
          "const": "SQLiteDatabase",
          "type": "string"
        },
        "name": {
          "maxLength": 63,
          "minLength": 1,
          "pattern": "^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$",
          "type": "string"
        }
      },
      "required": [
        "apiVersion",
        "kind",
        "name"
      ],
      "type": "object",
      "x-takoform-target-formrefs": [
        {
          "apiVersion": "edge.forms.takoform.com",
          "definitionVersion": "0.1.0",
          "kind": "SQLiteDatabase",
          "schemaDigest": "sha256:c72eeb66ef96c4679b5c724fa1219d71c89bb7eeb9e543d73d868ec41bddddfe"
        }
      ]
    },
    "migrationSet": {
      "additionalProperties": false,
      "description": "Exact immutable SQLite Migration Set whose ordered manifest must extend the database ledger.",
      "properties": {
        "apiVersion": {
          "const": "edge.forms.takoform.com",
          "type": "string"
        },
        "kind": {
          "const": "SQLiteMigrationSet",
          "type": "string"
        },
        "name": {
          "maxLength": 63,
          "minLength": 1,
          "pattern": "^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$",
          "type": "string"
        }
      },
      "required": [
        "apiVersion",
        "kind",
        "name"
      ],
      "type": "object",
      "x-takoform-target-formrefs": [
        {
          "apiVersion": "edge.forms.takoform.com",
          "definitionVersion": "0.1.0",
          "kind": "SQLiteMigrationSet",
          "schemaDigest": "sha256:05a4aa2ebd8fbf659f05ae378288d9c9657cc7478e1437f013732199bfcce7b9"
        }
      ]
    }
  },
  "required": [
    "database",
    "migrationSet"
  ],
  "title": "SQLite Migration Application desired state",
  "type": "object"
}

ライフサイクル

役割: attachment

  • create
  • read
  • delete
  • import
  • observe

提供するInterface

ありません。

パッケージ参照

項目
KindSQLiteMigrationApplication
Package digestsha256:0ae795b0c8a05672817e5e1a365562ecdc2cdeedf3c7477a8ecfc4f3bdf974ca
Schema digestsha256:f3b42ede7bad664e494a04ea6f0fd167082988688fe96f4ec1fbb80db13a8e01
Tagforms/k-mvsgozjomzxxe3ltfz2gc23pmzxxe3jomnxw2l2tkfggs5dfjvuwo4tboruw63sbobygy2ldmf2gs33o/sha256-0ae795b0c8a05672817e5e1a365562ecdc2cdeedf3c7477a8ecfc4f3bdf974ca
Source pathforms/releases/k-mvsgozjomzxxe3ltfz2gc23pmzxxe3jomnxw2l2tkfggs5dfjvuwo4tboruw63sbobygy2ldmf2gs33o/sha256-0ae795b0c8a05672817e5e1a365562ecdc2cdeedf3c7477a8ecfc4f3bdf974ca
署名セットe7f8a39311dd011b8467e97e7f300cabb9a6b06c

変更不可のパッケージを開く

4項目のFormRef
json
{
  "apiVersion": "edge.forms.takoform.com",
  "kind": "SQLiteMigrationApplication",
  "definitionVersion": "0.1.0",
  "schemaDigest": "sha256:f3b42ede7bad664e494a04ea6f0fd167082988688fe96f4ec1fbb80db13a8e01"
}