@intentius/sql-yodeler 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -24
- package/dist/bin.js +15 -0
- package/dist/bin.js.map +1 -1
- package/dist/chant/apply.d.ts +9 -1
- package/dist/chant/apply.js +13 -1
- package/dist/chant/apply.js.map +1 -1
- package/dist/chant/drift.d.ts +69 -1
- package/dist/chant/drift.js +152 -5
- package/dist/chant/drift.js.map +1 -1
- package/dist/chant/runnable.d.ts +19 -0
- package/dist/chant/runnable.js +47 -0
- package/dist/chant/runnable.js.map +1 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.js +40 -0
- package/dist/cli.js.map +1 -1
- package/dist/command.d.ts +6 -0
- package/dist/command.js.map +1 -1
- package/dist/commands/apply.js +161 -41
- package/dist/commands/apply.js.map +1 -1
- package/dist/commands/approve.d.ts +5 -0
- package/dist/commands/approve.js +111 -0
- package/dist/commands/approve.js.map +1 -0
- package/dist/commands/drift.d.ts +11 -0
- package/dist/commands/drift.js +247 -18
- package/dist/commands/drift.js.map +1 -1
- package/dist/commands/index.js +6 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.js +15 -11
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/lint.js +14 -5
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/mcp.d.ts +3 -0
- package/dist/commands/mcp.js +50 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/new.d.ts +2 -0
- package/dist/commands/new.js +134 -10
- package/dist/commands/new.js.map +1 -1
- package/dist/commands/override.d.ts +3 -0
- package/dist/commands/override.js +118 -0
- package/dist/commands/override.js.map +1 -0
- package/dist/commands/plan.js +38 -26
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/repair.d.ts +11 -0
- package/dist/commands/repair.js +15 -7
- package/dist/commands/repair.js.map +1 -1
- package/dist/commands/status.js +12 -12
- package/dist/commands/status.js.map +1 -1
- package/dist/config/define.d.ts +101 -3
- package/dist/config/define.js +1 -1
- package/dist/config/define.js.map +1 -1
- package/dist/config/load.js +64 -4
- package/dist/config/load.js.map +1 -1
- package/dist/config/settings.d.ts +14 -1
- package/dist/config/settings.js +32 -4
- package/dist/config/settings.js.map +1 -1
- package/dist/env-args.d.ts +6 -0
- package/dist/env-args.js +31 -1
- package/dist/env-args.js.map +1 -1
- package/dist/exit.d.ts +20 -0
- package/dist/exit.js +28 -0
- package/dist/exit.js.map +1 -0
- package/dist/history/client.d.ts +8 -0
- package/dist/history/client.js +24 -1
- package/dist/history/client.js.map +1 -1
- package/dist/history/lock.d.ts +5 -1
- package/dist/history/lock.js +8 -2
- package/dist/history/lock.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/init/adopt.js +8 -3
- package/dist/init/adopt.js.map +1 -1
- package/dist/init/live.d.ts +11 -0
- package/dist/init/live.js +25 -2
- package/dist/init/live.js.map +1 -1
- package/dist/lint/check.d.ts +8 -1
- package/dist/lint/check.js +23 -4
- package/dist/lint/check.js.map +1 -1
- package/dist/mcp/server.d.ts +40 -0
- package/dist/mcp/server.js +106 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +72 -0
- package/dist/mcp/tools.js +178 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/migrations/checks.d.ts +28 -0
- package/dist/migrations/checks.js +97 -0
- package/dist/migrations/checks.js.map +1 -0
- package/dist/migrations/create.d.ts +3 -1
- package/dist/migrations/create.js +1 -0
- package/dist/migrations/create.js.map +1 -1
- package/dist/migrations/directory.js +4 -0
- package/dist/migrations/directory.js.map +1 -1
- package/dist/migrations/document.d.ts +23 -0
- package/dist/migrations/document.js +1 -0
- package/dist/migrations/document.js.map +1 -1
- package/dist/migrations/index.d.ts +1 -0
- package/dist/migrations/index.js +1 -0
- package/dist/migrations/index.js.map +1 -1
- package/dist/pr/forge.d.ts +4 -0
- package/dist/pr/forge.js +21 -7
- package/dist/pr/forge.js.map +1 -1
- package/dist/pr/issue.d.ts +68 -0
- package/dist/pr/issue.js +107 -0
- package/dist/pr/issue.js.map +1 -0
- package/dist/pr/model.d.ts +9 -1
- package/dist/pr/model.js +30 -6
- package/dist/pr/model.js.map +1 -1
- package/dist/pr/render.d.ts +3 -1
- package/dist/pr/render.js +36 -3
- package/dist/pr/render.js.map +1 -1
- package/dist/replay/index.d.ts +3 -0
- package/dist/replay/index.js +3 -0
- package/dist/replay/index.js.map +1 -1
- package/dist/replay/replay.js +1 -1
- package/dist/replay/replay.js.map +1 -1
- package/dist/replay/shared.d.ts +28 -0
- package/dist/replay/shared.js +77 -0
- package/dist/replay/shared.js.map +1 -0
- package/dist/schemas.d.ts +34 -0
- package/dist/schemas.js +38 -0
- package/dist/schemas.js.map +1 -0
- package/dist/server.d.ts +40 -0
- package/dist/server.js +87 -0
- package/dist/server.js.map +1 -0
- package/dist/steps/backfill.d.ts +21 -17
- package/dist/steps/backfill.js +20 -20
- package/dist/steps/backfill.js.map +1 -1
- package/dist/steps/index.d.ts +2 -2
- package/dist/steps/index.js +3 -3
- package/dist/steps/index.js.map +1 -1
- package/dist/steps/rebuild.d.ts +15 -15
- package/dist/steps/rebuild.js +17 -24
- package/dist/steps/rebuild.js.map +1 -1
- package/dist/versioned/checks.d.ts +29 -0
- package/dist/versioned/checks.js +54 -0
- package/dist/versioned/checks.js.map +1 -0
- package/dist/versioned/clickhouse.js +8 -0
- package/dist/versioned/clickhouse.js.map +1 -1
- package/dist/versioned/driver.d.ts +10 -0
- package/dist/versioned/engine.d.ts +55 -1
- package/dist/versioned/engine.js +99 -6
- package/dist/versioned/engine.js.map +1 -1
- package/dist/versioned/explain.js +7 -2
- package/dist/versioned/explain.js.map +1 -1
- package/dist/versioned/index.d.ts +9 -0
- package/dist/versioned/index.js +24 -1
- package/dist/versioned/index.js.map +1 -1
- package/dist/versioned/op.d.ts +10 -0
- package/dist/versioned/op.js +36 -4
- package/dist/versioned/op.js.map +1 -1
- package/dist/versioned/policy.d.ts +67 -0
- package/dist/versioned/policy.js +161 -0
- package/dist/versioned/policy.js.map +1 -0
- package/dist/versioned/postgres/driver.d.ts +3 -1
- package/dist/versioned/postgres/driver.js +30 -3
- package/dist/versioned/postgres/driver.js.map +1 -1
- package/dist/versioned/postgres/waits.d.ts +46 -0
- package/dist/versioned/postgres/waits.js +78 -0
- package/dist/versioned/postgres/waits.js.map +1 -0
- package/dist/versioned/report.d.ts +3 -0
- package/dist/versioned/report.js +4 -1
- package/dist/versioned/report.js.map +1 -1
- package/dist/versioned/stand-down.d.ts +30 -0
- package/dist/versioned/stand-down.js +56 -0
- package/dist/versioned/stand-down.js.map +1 -0
- package/package.json +18 -8
- package/schemas/apply.schema.json +269 -0
- package/schemas/common.schema.json +213 -0
- package/schemas/drift.schema.json +36 -0
- package/schemas/init.schema.json +31 -0
- package/schemas/lint-rules.schema.json +54 -0
- package/schemas/lint.schema.json +290 -0
- package/schemas/mcp.schema.json +70 -0
- package/schemas/new.schema.json +71 -0
- package/schemas/plan.schema.json +371 -0
- package/schemas/rebase.schema.json +54 -0
- package/schemas/repair.schema.json +20 -0
- package/schemas/status.schema.json +310 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/sql-yodeler/schemas/v1/mcp.schema.json",
|
|
4
|
+
"title": "A yodel mcp tool result",
|
|
5
|
+
"description": "Version 1. Every tool of yodel mcp returns this envelope, as the call's structuredContent and as its text. results follows the schema resultsSchema names: the command's own (status, plan, lint, drift) or a definition here (history, explain). Within a version, fields are only added; a reader ignores fields it does not know.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["schema", "tool", "command", "exit", "results", "resultsSchema"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"schema": { "description": "The envelope's version.", "const": 1 },
|
|
11
|
+
"tool": { "enum": ["status", "plan", "lint", "drift", "history", "explain"] },
|
|
12
|
+
"command": { "description": "The yodel command line the tool ran.", "type": "string" },
|
|
13
|
+
"exit": { "description": "The command's exit code, the same as on a terminal (yodel --help lists them).", "type": "integer" },
|
|
14
|
+
"results": { "description": "What the command printed with --json; null when it printed nothing (it failed: see error)." },
|
|
15
|
+
"resultsSchema": { "description": "The $id of the schema results follows.", "type": "string" },
|
|
16
|
+
"error": { "description": "What the command wrote to stderr: why it failed when results is null, else notices.", "type": "string" },
|
|
17
|
+
"forPerson": {
|
|
18
|
+
"description": "Steps that belong to a person, each with the command the person runs. An agent shows them and never runs them.",
|
|
19
|
+
"type": "array",
|
|
20
|
+
"items": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"additionalProperties": false,
|
|
23
|
+
"required": ["action", "command"],
|
|
24
|
+
"properties": { "action": { "type": "string" }, "command": { "type": "string" } }
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"$defs": {
|
|
29
|
+
"history": {
|
|
30
|
+
"description": "The history tool: the migrations the environment's history records applied, from yodel status.",
|
|
31
|
+
"type": "object",
|
|
32
|
+
"additionalProperties": false,
|
|
33
|
+
"required": ["environment", "history", "applied"],
|
|
34
|
+
"properties": {
|
|
35
|
+
"environment": { "type": "string" },
|
|
36
|
+
"server": { "$ref": "common.schema.json#/$defs/server" },
|
|
37
|
+
"history": { "$ref": "status.schema.json#/$defs/report/properties/history" },
|
|
38
|
+
"applied": { "$ref": "status.schema.json#/$defs/report/properties/applied" }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"explain": {
|
|
42
|
+
"description": "The explain tool: a lint rule, or an exit code.",
|
|
43
|
+
"oneOf": [
|
|
44
|
+
{
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["topic", "kind", "rule", "docs"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"topic": { "type": "string" },
|
|
50
|
+
"kind": { "const": "lint-rule" },
|
|
51
|
+
"rule": { "$ref": "lint-rules.schema.json#/items" },
|
|
52
|
+
"docs": { "type": "string" }
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"type": "object",
|
|
57
|
+
"additionalProperties": false,
|
|
58
|
+
"required": ["topic", "kind", "code", "meaning", "docs"],
|
|
59
|
+
"properties": {
|
|
60
|
+
"topic": { "type": "string" },
|
|
61
|
+
"kind": { "const": "exit-code" },
|
|
62
|
+
"code": { "type": "integer" },
|
|
63
|
+
"meaning": { "type": "string" },
|
|
64
|
+
"docs": { "type": "string" }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/sql-yodeler/schemas/v1/new.schema.json",
|
|
4
|
+
"title": "yodel new <name> --json",
|
|
5
|
+
"description": "Version 1. The migration written (written true), or why none was: a backfill template to fill in, a --replace that kept the migration, or no change from the newest migration's recorded schema. Within a version, fields are only added; a reader ignores fields it does not know.",
|
|
6
|
+
"oneOf": [{ "$ref": "#/$defs/written" }, { "$ref": "#/$defs/template" }, { "$ref": "#/$defs/kept" }, { "$ref": "#/$defs/unchanged" }],
|
|
7
|
+
"$defs": {
|
|
8
|
+
"written": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"additionalProperties": false,
|
|
11
|
+
"required": ["written", "id", "path", "parent", "checksum", "dialect", "statements", "ops", "manual", "hints", "checks"],
|
|
12
|
+
"properties": {
|
|
13
|
+
"written": { "const": true },
|
|
14
|
+
"id": { "type": "string" },
|
|
15
|
+
"path": { "type": "string" },
|
|
16
|
+
"parent": { "type": ["string", "null"] },
|
|
17
|
+
"checksum": { "type": "string" },
|
|
18
|
+
"dialect": { "$ref": "common.schema.json#/$defs/dialect" },
|
|
19
|
+
"statements": { "type": "integer", "minimum": 0 },
|
|
20
|
+
"ops": {
|
|
21
|
+
"description": "The Op steps written, which yodel apply runs or refuses.",
|
|
22
|
+
"type": "array",
|
|
23
|
+
"items": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"required": ["op", "object", "name", "rules"],
|
|
27
|
+
"properties": { "op": { "type": "string" }, "object": { "type": "string" }, "name": { "type": "string" }, "rules": { "$ref": "common.schema.json#/$defs/stringList" } }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"manual": {
|
|
31
|
+
"description": "The manual steps written: yodel apply refuses them.",
|
|
32
|
+
"type": "array",
|
|
33
|
+
"items": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["object", "name", "rules", "detail"],
|
|
37
|
+
"properties": { "object": { "type": "string" }, "name": { "type": "string" }, "rules": { "$ref": "common.schema.json#/$defs/stringList" }, "detail": { "type": "string" } }
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"hints": { "$ref": "common.schema.json#/$defs/stringList" },
|
|
41
|
+
"checks": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/check" } }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"template": {
|
|
45
|
+
"description": "--backfill named a file that is not there: the template was written to it, and no migration.",
|
|
46
|
+
"type": "object",
|
|
47
|
+
"additionalProperties": false,
|
|
48
|
+
"required": ["written", "template"],
|
|
49
|
+
"properties": { "written": { "const": false }, "template": { "type": "string" } }
|
|
50
|
+
},
|
|
51
|
+
"kept": {
|
|
52
|
+
"description": "--replace: the replacement would be the same, so the migration was kept.",
|
|
53
|
+
"type": "object",
|
|
54
|
+
"additionalProperties": false,
|
|
55
|
+
"required": ["written", "replaced", "kept"],
|
|
56
|
+
"properties": { "written": { "const": false }, "replaced": { "type": "null" }, "kept": { "type": "string" } }
|
|
57
|
+
},
|
|
58
|
+
"unchanged": {
|
|
59
|
+
"description": "The declared schema matches the newest migration's recorded schema.",
|
|
60
|
+
"type": "object",
|
|
61
|
+
"additionalProperties": false,
|
|
62
|
+
"required": ["written", "parent", "dialect", "hints"],
|
|
63
|
+
"properties": {
|
|
64
|
+
"written": { "const": false },
|
|
65
|
+
"parent": { "type": ["string", "null"] },
|
|
66
|
+
"dialect": { "$ref": "common.schema.json#/$defs/dialect" },
|
|
67
|
+
"hints": { "$ref": "common.schema.json#/$defs/stringList" }
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/sql-yodeler/schemas/v1/plan.schema.json",
|
|
4
|
+
"title": "yodel plan <env> --json",
|
|
5
|
+
"description": "Version 1. A project with migrations prints the versioned plan (mode \"versioned\"); a project without prints the declarative plan, chant's diff with the environment and dialect it is of. Within a version, fields are only added; a reader ignores fields it does not know.",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "#/$defs/versioned"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"$ref": "#/$defs/declarative"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"$defs": {
|
|
15
|
+
"declarative": {
|
|
16
|
+
"description": "chant's diff (chant sql plan --json) with environment, dialect and server added. chant owns the diff's fields: ones beyond those listed may appear.",
|
|
17
|
+
"type": "object",
|
|
18
|
+
"required": [
|
|
19
|
+
"environment",
|
|
20
|
+
"dialect",
|
|
21
|
+
"changes",
|
|
22
|
+
"hints"
|
|
23
|
+
],
|
|
24
|
+
"properties": {
|
|
25
|
+
"environment": {
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"dialect": {
|
|
29
|
+
"$ref": "common.schema.json#/$defs/dialect"
|
|
30
|
+
},
|
|
31
|
+
"server": {
|
|
32
|
+
"$ref": "common.schema.json#/$defs/server"
|
|
33
|
+
},
|
|
34
|
+
"changes": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"items": {
|
|
37
|
+
"$ref": "common.schema.json#/$defs/change"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"hints": {
|
|
41
|
+
"$ref": "common.schema.json#/$defs/stringList"
|
|
42
|
+
},
|
|
43
|
+
"rebuilds": {
|
|
44
|
+
"description": "ClickHouse: the changes that need a ClickHouseRebuildOp.",
|
|
45
|
+
"type": "array",
|
|
46
|
+
"items": {
|
|
47
|
+
"$ref": "common.schema.json#/$defs/change"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"rebuildOps": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"items": {
|
|
53
|
+
"type": "object"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"refused": {
|
|
57
|
+
"description": "Postgres: the changes that need a PostgresMigrationOp.",
|
|
58
|
+
"type": "array",
|
|
59
|
+
"items": {
|
|
60
|
+
"$ref": "common.schema.json#/$defs/change"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"migrationOps": {
|
|
64
|
+
"type": "array",
|
|
65
|
+
"items": {
|
|
66
|
+
"type": "object"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"mode": false
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"stepChange": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"additionalProperties": false,
|
|
75
|
+
"required": [
|
|
76
|
+
"rule",
|
|
77
|
+
"class",
|
|
78
|
+
"field"
|
|
79
|
+
],
|
|
80
|
+
"properties": {
|
|
81
|
+
"rule": {
|
|
82
|
+
"type": "string"
|
|
83
|
+
},
|
|
84
|
+
"class": {
|
|
85
|
+
"type": "string"
|
|
86
|
+
},
|
|
87
|
+
"field": {
|
|
88
|
+
"type": "string"
|
|
89
|
+
},
|
|
90
|
+
"destructive": {
|
|
91
|
+
"const": true
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"step": {
|
|
96
|
+
"type": "object",
|
|
97
|
+
"additionalProperties": false,
|
|
98
|
+
"required": [
|
|
99
|
+
"index",
|
|
100
|
+
"kind",
|
|
101
|
+
"object",
|
|
102
|
+
"name",
|
|
103
|
+
"done"
|
|
104
|
+
],
|
|
105
|
+
"properties": {
|
|
106
|
+
"index": {
|
|
107
|
+
"type": "integer",
|
|
108
|
+
"minimum": 0
|
|
109
|
+
},
|
|
110
|
+
"kind": {
|
|
111
|
+
"enum": [
|
|
112
|
+
"statement",
|
|
113
|
+
"op",
|
|
114
|
+
"manual"
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
"object": {
|
|
118
|
+
"type": "string"
|
|
119
|
+
},
|
|
120
|
+
"name": {
|
|
121
|
+
"type": "string"
|
|
122
|
+
},
|
|
123
|
+
"rule": {
|
|
124
|
+
"type": "string"
|
|
125
|
+
},
|
|
126
|
+
"class": {
|
|
127
|
+
"type": "string"
|
|
128
|
+
},
|
|
129
|
+
"destructive": {
|
|
130
|
+
"const": true
|
|
131
|
+
},
|
|
132
|
+
"changes": {
|
|
133
|
+
"type": "array",
|
|
134
|
+
"items": {
|
|
135
|
+
"$ref": "#/$defs/stepChange"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"sql": {
|
|
139
|
+
"description": "A statement step's SQL, with passwords, secrets and tokens redacted.",
|
|
140
|
+
"type": "string"
|
|
141
|
+
},
|
|
142
|
+
"detail": {
|
|
143
|
+
"type": "string"
|
|
144
|
+
},
|
|
145
|
+
"op": {
|
|
146
|
+
"type": "string"
|
|
147
|
+
},
|
|
148
|
+
"applyRuns": {
|
|
149
|
+
"description": "An Op or manual step: whether yodel apply runs it.",
|
|
150
|
+
"type": "boolean"
|
|
151
|
+
},
|
|
152
|
+
"refused": {
|
|
153
|
+
"description": "Why yodel apply does not run this step.",
|
|
154
|
+
"type": "string"
|
|
155
|
+
},
|
|
156
|
+
"done": {
|
|
157
|
+
"description": "It succeeded in an earlier run and is not sent again.",
|
|
158
|
+
"type": "boolean"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"moved": {
|
|
163
|
+
"type": "array",
|
|
164
|
+
"items": {
|
|
165
|
+
"type": "object",
|
|
166
|
+
"additionalProperties": false,
|
|
167
|
+
"required": [
|
|
168
|
+
"part",
|
|
169
|
+
"message"
|
|
170
|
+
],
|
|
171
|
+
"properties": {
|
|
172
|
+
"part": {
|
|
173
|
+
"enum": [
|
|
174
|
+
"environment",
|
|
175
|
+
"history",
|
|
176
|
+
"pending",
|
|
177
|
+
"live"
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
"message": {
|
|
181
|
+
"type": "string"
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"versioned": {
|
|
187
|
+
"type": "object",
|
|
188
|
+
"additionalProperties": false,
|
|
189
|
+
"required": [
|
|
190
|
+
"environment",
|
|
191
|
+
"dialect",
|
|
192
|
+
"mode",
|
|
193
|
+
"applied",
|
|
194
|
+
"pending",
|
|
195
|
+
"problems",
|
|
196
|
+
"notes"
|
|
197
|
+
],
|
|
198
|
+
"properties": {
|
|
199
|
+
"environment": {
|
|
200
|
+
"type": "string"
|
|
201
|
+
},
|
|
202
|
+
"dialect": {
|
|
203
|
+
"$ref": "common.schema.json#/$defs/dialect"
|
|
204
|
+
},
|
|
205
|
+
"mode": {
|
|
206
|
+
"const": "versioned"
|
|
207
|
+
},
|
|
208
|
+
"server": {
|
|
209
|
+
"$ref": "common.schema.json#/$defs/server"
|
|
210
|
+
},
|
|
211
|
+
"history": {
|
|
212
|
+
"description": "<database>.history, and on ClickHouse the topology and where it came from.",
|
|
213
|
+
"type": "string"
|
|
214
|
+
},
|
|
215
|
+
"applied": {
|
|
216
|
+
"description": "How many migrations the history records applied.",
|
|
217
|
+
"type": "integer",
|
|
218
|
+
"minimum": 0
|
|
219
|
+
},
|
|
220
|
+
"pending": {
|
|
221
|
+
"type": "array",
|
|
222
|
+
"items": {
|
|
223
|
+
"type": "object",
|
|
224
|
+
"additionalProperties": false,
|
|
225
|
+
"required": [
|
|
226
|
+
"id",
|
|
227
|
+
"outOfOrder",
|
|
228
|
+
"steps"
|
|
229
|
+
],
|
|
230
|
+
"properties": {
|
|
231
|
+
"id": {
|
|
232
|
+
"type": "string"
|
|
233
|
+
},
|
|
234
|
+
"outOfOrder": {
|
|
235
|
+
"type": "boolean"
|
|
236
|
+
},
|
|
237
|
+
"resumeAt": {
|
|
238
|
+
"type": "integer"
|
|
239
|
+
},
|
|
240
|
+
"checks": {
|
|
241
|
+
"type": "array",
|
|
242
|
+
"items": {
|
|
243
|
+
"$ref": "common.schema.json#/$defs/check"
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"steps": {
|
|
247
|
+
"type": "array",
|
|
248
|
+
"items": {
|
|
249
|
+
"$ref": "#/$defs/step"
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
"problems": {
|
|
256
|
+
"description": "Directory problems, checksum mismatches, out-of-order migrations.",
|
|
257
|
+
"$ref": "common.schema.json#/$defs/stringList"
|
|
258
|
+
},
|
|
259
|
+
"refusal": {
|
|
260
|
+
"$ref": "common.schema.json#/$defs/refusal"
|
|
261
|
+
},
|
|
262
|
+
"planDigest": {
|
|
263
|
+
"description": "The digest the migrations Op's gate binds; absent when apply would refuse or has nothing to do.",
|
|
264
|
+
"type": "string"
|
|
265
|
+
},
|
|
266
|
+
"policy": {
|
|
267
|
+
"$ref": "common.schema.json#/$defs/policy"
|
|
268
|
+
},
|
|
269
|
+
"op": {
|
|
270
|
+
"description": "The migrations Op.",
|
|
271
|
+
"type": "string"
|
|
272
|
+
},
|
|
273
|
+
"gate": {
|
|
274
|
+
"description": "The Op's gate.",
|
|
275
|
+
"type": "string"
|
|
276
|
+
},
|
|
277
|
+
"approve": {
|
|
278
|
+
"description": "The command a person runs to approve this plan. An agent prints it and never runs it.",
|
|
279
|
+
"type": "string"
|
|
280
|
+
},
|
|
281
|
+
"approval": {
|
|
282
|
+
"description": "The newest approval of the gate in chant's ledger.",
|
|
283
|
+
"type": "object",
|
|
284
|
+
"additionalProperties": false,
|
|
285
|
+
"required": [
|
|
286
|
+
"by",
|
|
287
|
+
"at",
|
|
288
|
+
"holds",
|
|
289
|
+
"sameDigest"
|
|
290
|
+
],
|
|
291
|
+
"properties": {
|
|
292
|
+
"digest": {
|
|
293
|
+
"type": "string"
|
|
294
|
+
},
|
|
295
|
+
"by": {
|
|
296
|
+
"type": "string"
|
|
297
|
+
},
|
|
298
|
+
"at": {
|
|
299
|
+
"type": "string"
|
|
300
|
+
},
|
|
301
|
+
"holds": {
|
|
302
|
+
"type": "boolean"
|
|
303
|
+
},
|
|
304
|
+
"sameDigest": {
|
|
305
|
+
"type": "boolean"
|
|
306
|
+
},
|
|
307
|
+
"askedAgain": {
|
|
308
|
+
"type": "object",
|
|
309
|
+
"additionalProperties": false,
|
|
310
|
+
"required": [
|
|
311
|
+
"at"
|
|
312
|
+
],
|
|
313
|
+
"properties": {
|
|
314
|
+
"at": {
|
|
315
|
+
"type": "string"
|
|
316
|
+
},
|
|
317
|
+
"digest": {
|
|
318
|
+
"type": "string"
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
"moved": {
|
|
323
|
+
"type": "object",
|
|
324
|
+
"additionalProperties": false,
|
|
325
|
+
"required": [
|
|
326
|
+
"confirmed",
|
|
327
|
+
"changes"
|
|
328
|
+
],
|
|
329
|
+
"properties": {
|
|
330
|
+
"confirmed": {
|
|
331
|
+
"type": "boolean"
|
|
332
|
+
},
|
|
333
|
+
"changes": {
|
|
334
|
+
"$ref": "#/$defs/moved"
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
"opMissing": {
|
|
341
|
+
"description": "The project declares no migrations Op for the environment: the first line of how to declare one.",
|
|
342
|
+
"type": "string"
|
|
343
|
+
},
|
|
344
|
+
"sinceLast": {
|
|
345
|
+
"description": "The pull request comment this plan replaces showed another digest: what moved since.",
|
|
346
|
+
"type": "object",
|
|
347
|
+
"additionalProperties": false,
|
|
348
|
+
"required": [
|
|
349
|
+
"digest",
|
|
350
|
+
"confirmed",
|
|
351
|
+
"changes"
|
|
352
|
+
],
|
|
353
|
+
"properties": {
|
|
354
|
+
"digest": {
|
|
355
|
+
"type": "string"
|
|
356
|
+
},
|
|
357
|
+
"confirmed": {
|
|
358
|
+
"type": "boolean"
|
|
359
|
+
},
|
|
360
|
+
"changes": {
|
|
361
|
+
"$ref": "#/$defs/moved"
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
"notes": {
|
|
366
|
+
"$ref": "common.schema.json#/$defs/stringList"
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/sql-yodeler/schemas/v1/rebase.schema.json",
|
|
4
|
+
"title": "yodel rebase --json",
|
|
5
|
+
"description": "Version 1. The migration moved onto its new parent and every migration rewritten, or rebased false when there was nothing to move. Within a version, fields are only added; a reader ignores fields it does not know.",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{
|
|
8
|
+
"type": "object",
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"required": ["rebased"],
|
|
11
|
+
"properties": { "rebased": { "const": false } }
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"required": ["rebased", "moved", "from", "onto", "historiesChecked", "rewritten"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"rebased": { "const": true },
|
|
19
|
+
"moved": { "type": "string" },
|
|
20
|
+
"from": { "type": ["string", "null"] },
|
|
21
|
+
"onto": { "type": "string" },
|
|
22
|
+
"historiesChecked": { "description": "The environments (--env) whose histories were checked so a migration that ran is never moved.", "$ref": "common.schema.json#/$defs/stringList" },
|
|
23
|
+
"rewritten": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"additionalProperties": false,
|
|
28
|
+
"required": ["id", "path", "oldParent", "parent", "oldChecksum", "checksum", "statements", "refused", "silences", "handEdited"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"id": { "type": "string" },
|
|
31
|
+
"path": { "type": "string" },
|
|
32
|
+
"oldParent": { "type": ["string", "null"] },
|
|
33
|
+
"parent": { "type": ["string", "null"] },
|
|
34
|
+
"oldChecksum": { "type": "string" },
|
|
35
|
+
"checksum": { "type": "string" },
|
|
36
|
+
"statements": { "type": "integer", "minimum": 0 },
|
|
37
|
+
"refused": { "type": "boolean" },
|
|
38
|
+
"silences": {
|
|
39
|
+
"type": "array",
|
|
40
|
+
"items": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"additionalProperties": false,
|
|
43
|
+
"required": ["step", "rule", "reason", "line"],
|
|
44
|
+
"properties": { "step": { "type": "integer" }, "rule": { "type": "string" }, "reason": { "type": "string" }, "line": { "type": "integer" } }
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"handEdited": { "type": "boolean" }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/sql-yodeler/schemas/v1/repair.schema.json",
|
|
4
|
+
"title": "yodel repair <env> <id> --reason <text> --json",
|
|
5
|
+
"description": "Version 1. The checksum recorded for an applied migration, with the reason, and whether migration.json's own checksum field was written again. Within a version, fields are only added; a reader ignores fields it does not know.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["repaired", "id", "environment", "oldChecksum", "newChecksum", "reason", "seq", "runId", "migrationJsonUpdated"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"repaired": { "const": true },
|
|
11
|
+
"id": { "type": "string" },
|
|
12
|
+
"environment": { "type": "string" },
|
|
13
|
+
"oldChecksum": { "type": "string" },
|
|
14
|
+
"newChecksum": { "type": "string" },
|
|
15
|
+
"reason": { "type": "string" },
|
|
16
|
+
"seq": { "type": "integer" },
|
|
17
|
+
"runId": { "type": "string" },
|
|
18
|
+
"migrationJsonUpdated": { "type": "boolean" }
|
|
19
|
+
}
|
|
20
|
+
}
|