@intentius/sql-yodeler 0.0.0-stage → 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.
Files changed (324) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +112 -2
  3. package/dist/bin.d.ts +2 -0
  4. package/dist/bin.js +29 -0
  5. package/dist/bin.js.map +1 -0
  6. package/dist/chant/apply.d.ts +59 -0
  7. package/dist/chant/apply.js +116 -0
  8. package/dist/chant/apply.js.map +1 -0
  9. package/dist/chant/build.d.ts +34 -0
  10. package/dist/chant/build.js +48 -0
  11. package/dist/chant/build.js.map +1 -0
  12. package/dist/chant/drift.d.ts +112 -0
  13. package/dist/chant/drift.js +238 -0
  14. package/dist/chant/drift.js.map +1 -0
  15. package/dist/chant/plan.d.ts +45 -0
  16. package/dist/chant/plan.js +61 -0
  17. package/dist/chant/plan.js.map +1 -0
  18. package/dist/chant/process.d.ts +41 -0
  19. package/dist/chant/process.js +87 -0
  20. package/dist/chant/process.js.map +1 -0
  21. package/dist/chant/runnable.d.ts +19 -0
  22. package/dist/chant/runnable.js +47 -0
  23. package/dist/chant/runnable.js.map +1 -0
  24. package/dist/cli.d.ts +8 -0
  25. package/dist/cli.js +99 -0
  26. package/dist/cli.js.map +1 -0
  27. package/dist/command.d.ts +23 -0
  28. package/dist/command.js +13 -0
  29. package/dist/command.js.map +1 -0
  30. package/dist/commands/apply.d.ts +3 -0
  31. package/dist/commands/apply.js +426 -0
  32. package/dist/commands/apply.js.map +1 -0
  33. package/dist/commands/approve.d.ts +5 -0
  34. package/dist/commands/approve.js +111 -0
  35. package/dist/commands/approve.js.map +1 -0
  36. package/dist/commands/drift.d.ts +14 -0
  37. package/dist/commands/drift.js +267 -0
  38. package/dist/commands/drift.js.map +1 -0
  39. package/dist/commands/index.d.ts +3 -0
  40. package/dist/commands/index.js +28 -0
  41. package/dist/commands/index.js.map +1 -0
  42. package/dist/commands/init.d.ts +6 -0
  43. package/dist/commands/init.js +139 -0
  44. package/dist/commands/init.js.map +1 -0
  45. package/dist/commands/lint.d.ts +3 -0
  46. package/dist/commands/lint.js +202 -0
  47. package/dist/commands/lint.js.map +1 -0
  48. package/dist/commands/mcp.d.ts +3 -0
  49. package/dist/commands/mcp.js +50 -0
  50. package/dist/commands/mcp.js.map +1 -0
  51. package/dist/commands/new.d.ts +5 -0
  52. package/dist/commands/new.js +292 -0
  53. package/dist/commands/new.js.map +1 -0
  54. package/dist/commands/override.d.ts +3 -0
  55. package/dist/commands/override.js +118 -0
  56. package/dist/commands/override.js.map +1 -0
  57. package/dist/commands/plan.d.ts +3 -0
  58. package/dist/commands/plan.js +183 -0
  59. package/dist/commands/plan.js.map +1 -0
  60. package/dist/commands/rebase.d.ts +3 -0
  61. package/dist/commands/rebase.js +167 -0
  62. package/dist/commands/rebase.js.map +1 -0
  63. package/dist/commands/repair.d.ts +14 -0
  64. package/dist/commands/repair.js +125 -0
  65. package/dist/commands/repair.js.map +1 -0
  66. package/dist/commands/status.d.ts +7 -0
  67. package/dist/commands/status.js +54 -0
  68. package/dist/commands/status.js.map +1 -0
  69. package/dist/config/define.d.ts +148 -0
  70. package/dist/config/define.js +20 -0
  71. package/dist/config/define.js.map +1 -0
  72. package/dist/config/index.d.ts +11 -0
  73. package/dist/config/index.js +12 -0
  74. package/dist/config/index.js.map +1 -0
  75. package/dist/config/load.d.ts +17 -0
  76. package/dist/config/load.js +162 -0
  77. package/dist/config/load.js.map +1 -0
  78. package/dist/config/settings.d.ts +53 -0
  79. package/dist/config/settings.js +116 -0
  80. package/dist/config/settings.js.map +1 -0
  81. package/dist/env-args.d.ts +24 -0
  82. package/dist/env-args.js +92 -0
  83. package/dist/env-args.js.map +1 -0
  84. package/dist/exit.d.ts +20 -0
  85. package/dist/exit.js +28 -0
  86. package/dist/exit.js.map +1 -0
  87. package/dist/history/client.d.ts +25 -0
  88. package/dist/history/client.js +42 -0
  89. package/dist/history/client.js.map +1 -0
  90. package/dist/history/ddl.d.ts +58 -0
  91. package/dist/history/ddl.js +100 -0
  92. package/dist/history/ddl.js.map +1 -0
  93. package/dist/history/index.d.ts +25 -0
  94. package/dist/history/index.js +26 -0
  95. package/dist/history/index.js.map +1 -0
  96. package/dist/history/lock.d.ts +104 -0
  97. package/dist/history/lock.js +230 -0
  98. package/dist/history/lock.js.map +1 -0
  99. package/dist/history/postgres/ddl.d.ts +22 -0
  100. package/dist/history/postgres/ddl.js +47 -0
  101. package/dist/history/postgres/ddl.js.map +1 -0
  102. package/dist/history/postgres/index.d.ts +12 -0
  103. package/dist/history/postgres/index.js +13 -0
  104. package/dist/history/postgres/index.js.map +1 -0
  105. package/dist/history/postgres/lock.d.ts +48 -0
  106. package/dist/history/postgres/lock.js +95 -0
  107. package/dist/history/postgres/lock.js.map +1 -0
  108. package/dist/history/postgres/store.d.ts +39 -0
  109. package/dist/history/postgres/store.js +68 -0
  110. package/dist/history/postgres/store.js.map +1 -0
  111. package/dist/history/rows.d.ts +96 -0
  112. package/dist/history/rows.js +73 -0
  113. package/dist/history/rows.js.map +1 -0
  114. package/dist/history/store.d.ts +72 -0
  115. package/dist/history/store.js +134 -0
  116. package/dist/history/store.js.map +1 -0
  117. package/dist/history/topology.d.ts +41 -0
  118. package/dist/history/topology.js +54 -0
  119. package/dist/history/topology.js.map +1 -0
  120. package/dist/index.d.ts +10 -0
  121. package/dist/index.js +10 -0
  122. package/dist/index.js.map +1 -0
  123. package/dist/init/adopt.d.ts +70 -0
  124. package/dist/init/adopt.js +143 -0
  125. package/dist/init/adopt.js.map +1 -0
  126. package/dist/init/baseline.d.ts +61 -0
  127. package/dist/init/baseline.js +88 -0
  128. package/dist/init/baseline.js.map +1 -0
  129. package/dist/init/files.d.ts +23 -0
  130. package/dist/init/files.js +77 -0
  131. package/dist/init/files.js.map +1 -0
  132. package/dist/init/index.d.ts +16 -0
  133. package/dist/init/index.js +17 -0
  134. package/dist/init/index.js.map +1 -0
  135. package/dist/init/live.d.ts +39 -0
  136. package/dist/init/live.js +68 -0
  137. package/dist/init/live.js.map +1 -0
  138. package/dist/lint/check.d.ts +88 -0
  139. package/dist/lint/check.js +227 -0
  140. package/dist/lint/check.js.map +1 -0
  141. package/dist/lint/config.d.ts +21 -0
  142. package/dist/lint/config.js +43 -0
  143. package/dist/lint/config.js.map +1 -0
  144. package/dist/lint/index.d.ts +31 -0
  145. package/dist/lint/index.js +43 -0
  146. package/dist/lint/index.js.map +1 -0
  147. package/dist/lint/project-rules.d.ts +19 -0
  148. package/dist/lint/project-rules.js +32 -0
  149. package/dist/lint/project-rules.js.map +1 -0
  150. package/dist/lint/report.d.ts +7 -0
  151. package/dist/lint/report.js +48 -0
  152. package/dist/lint/report.js.map +1 -0
  153. package/dist/lint/rules.d.ts +53 -0
  154. package/dist/lint/rules.js +42 -0
  155. package/dist/lint/rules.js.map +1 -0
  156. package/dist/lint/silences.d.ts +49 -0
  157. package/dist/lint/silences.js +91 -0
  158. package/dist/lint/silences.js.map +1 -0
  159. package/dist/lint/statements.d.ts +38 -0
  160. package/dist/lint/statements.js +120 -0
  161. package/dist/lint/statements.js.map +1 -0
  162. package/dist/mcp/server.d.ts +40 -0
  163. package/dist/mcp/server.js +106 -0
  164. package/dist/mcp/server.js.map +1 -0
  165. package/dist/mcp/tools.d.ts +72 -0
  166. package/dist/mcp/tools.js +178 -0
  167. package/dist/mcp/tools.js.map +1 -0
  168. package/dist/migrations/checks.d.ts +28 -0
  169. package/dist/migrations/checks.js +97 -0
  170. package/dist/migrations/checks.js.map +1 -0
  171. package/dist/migrations/checksum.d.ts +56 -0
  172. package/dist/migrations/checksum.js +72 -0
  173. package/dist/migrations/checksum.js.map +1 -0
  174. package/dist/migrations/create.d.ts +75 -0
  175. package/dist/migrations/create.js +120 -0
  176. package/dist/migrations/create.js.map +1 -0
  177. package/dist/migrations/directory.d.ts +119 -0
  178. package/dist/migrations/directory.js +229 -0
  179. package/dist/migrations/directory.js.map +1 -0
  180. package/dist/migrations/document.d.ts +106 -0
  181. package/dist/migrations/document.js +83 -0
  182. package/dist/migrations/document.js.map +1 -0
  183. package/dist/migrations/index.d.ts +21 -0
  184. package/dist/migrations/index.js +22 -0
  185. package/dist/migrations/index.js.map +1 -0
  186. package/dist/pr/comment.d.ts +32 -0
  187. package/dist/pr/comment.js +99 -0
  188. package/dist/pr/comment.js.map +1 -0
  189. package/dist/pr/forge.d.ts +54 -0
  190. package/dist/pr/forge.js +119 -0
  191. package/dist/pr/forge.js.map +1 -0
  192. package/dist/pr/issue.d.ts +68 -0
  193. package/dist/pr/issue.js +107 -0
  194. package/dist/pr/issue.js.map +1 -0
  195. package/dist/pr/model.d.ts +99 -0
  196. package/dist/pr/model.js +137 -0
  197. package/dist/pr/model.js.map +1 -0
  198. package/dist/pr/render.d.ts +29 -0
  199. package/dist/pr/render.js +279 -0
  200. package/dist/pr/render.js.map +1 -0
  201. package/dist/project.d.ts +62 -0
  202. package/dist/project.js +92 -0
  203. package/dist/project.js.map +1 -0
  204. package/dist/rebase/index.d.ts +121 -0
  205. package/dist/rebase/index.js +390 -0
  206. package/dist/rebase/index.js.map +1 -0
  207. package/dist/rebase/repair.d.ts +41 -0
  208. package/dist/rebase/repair.js +68 -0
  209. package/dist/rebase/repair.js.map +1 -0
  210. package/dist/replay/clickhouse.d.ts +33 -0
  211. package/dist/replay/clickhouse.js +106 -0
  212. package/dist/replay/clickhouse.js.map +1 -0
  213. package/dist/replay/index.d.ts +39 -0
  214. package/dist/replay/index.js +57 -0
  215. package/dist/replay/index.js.map +1 -0
  216. package/dist/replay/postgres.d.ts +31 -0
  217. package/dist/replay/postgres.js +140 -0
  218. package/dist/replay/postgres.js.map +1 -0
  219. package/dist/replay/replay.d.ts +114 -0
  220. package/dist/replay/replay.js +98 -0
  221. package/dist/replay/replay.js.map +1 -0
  222. package/dist/replay/report.d.ts +18 -0
  223. package/dist/replay/report.js +72 -0
  224. package/dist/replay/report.js.map +1 -0
  225. package/dist/replay/shared.d.ts +28 -0
  226. package/dist/replay/shared.js +77 -0
  227. package/dist/replay/shared.js.map +1 -0
  228. package/dist/schemas.d.ts +34 -0
  229. package/dist/schemas.js +38 -0
  230. package/dist/schemas.js.map +1 -0
  231. package/dist/server.d.ts +40 -0
  232. package/dist/server.js +87 -0
  233. package/dist/server.js.map +1 -0
  234. package/dist/steps/backfill.d.ts +132 -0
  235. package/dist/steps/backfill.js +307 -0
  236. package/dist/steps/backfill.js.map +1 -0
  237. package/dist/steps/index.d.ts +52 -0
  238. package/dist/steps/index.js +52 -0
  239. package/dist/steps/index.js.map +1 -0
  240. package/dist/steps/kinds.d.ts +101 -0
  241. package/dist/steps/kinds.js +143 -0
  242. package/dist/steps/kinds.js.map +1 -0
  243. package/dist/steps/postgres-migration.d.ts +95 -0
  244. package/dist/steps/postgres-migration.js +149 -0
  245. package/dist/steps/postgres-migration.js.map +1 -0
  246. package/dist/steps/rebuild.d.ts +97 -0
  247. package/dist/steps/rebuild.js +155 -0
  248. package/dist/steps/rebuild.js.map +1 -0
  249. package/dist/steps/run.d.ts +45 -0
  250. package/dist/steps/run.js +72 -0
  251. package/dist/steps/run.js.map +1 -0
  252. package/dist/topology/render.d.ts +17 -0
  253. package/dist/topology/render.js +17 -0
  254. package/dist/topology/render.js.map +1 -0
  255. package/dist/version.d.ts +2 -0
  256. package/dist/version.js +11 -0
  257. package/dist/version.js.map +1 -0
  258. package/dist/versioned/approval.d.ts +35 -0
  259. package/dist/versioned/approval.js +53 -0
  260. package/dist/versioned/approval.js.map +1 -0
  261. package/dist/versioned/checks.d.ts +29 -0
  262. package/dist/versioned/checks.js +54 -0
  263. package/dist/versioned/checks.js.map +1 -0
  264. package/dist/versioned/clickhouse.d.ts +24 -0
  265. package/dist/versioned/clickhouse.js +42 -0
  266. package/dist/versioned/clickhouse.js.map +1 -0
  267. package/dist/versioned/digest.d.ts +77 -0
  268. package/dist/versioned/digest.js +69 -0
  269. package/dist/versioned/digest.js.map +1 -0
  270. package/dist/versioned/driver.d.ts +51 -0
  271. package/dist/versioned/driver.js +13 -0
  272. package/dist/versioned/driver.js.map +1 -0
  273. package/dist/versioned/engine.d.ts +206 -0
  274. package/dist/versioned/engine.js +370 -0
  275. package/dist/versioned/engine.js.map +1 -0
  276. package/dist/versioned/explain.d.ts +123 -0
  277. package/dist/versioned/explain.js +294 -0
  278. package/dist/versioned/explain.js.map +1 -0
  279. package/dist/versioned/index.d.ts +46 -0
  280. package/dist/versioned/index.js +77 -0
  281. package/dist/versioned/index.js.map +1 -0
  282. package/dist/versioned/op.d.ts +72 -0
  283. package/dist/versioned/op.js +185 -0
  284. package/dist/versioned/op.js.map +1 -0
  285. package/dist/versioned/policy.d.ts +67 -0
  286. package/dist/versioned/policy.js +161 -0
  287. package/dist/versioned/policy.js.map +1 -0
  288. package/dist/versioned/postgres/catalog.d.ts +33 -0
  289. package/dist/versioned/postgres/catalog.js +34 -0
  290. package/dist/versioned/postgres/catalog.js.map +1 -0
  291. package/dist/versioned/postgres/driver.d.ts +71 -0
  292. package/dist/versioned/postgres/driver.js +140 -0
  293. package/dist/versioned/postgres/driver.js.map +1 -0
  294. package/dist/versioned/postgres/executor.d.ts +104 -0
  295. package/dist/versioned/postgres/executor.js +172 -0
  296. package/dist/versioned/postgres/executor.js.map +1 -0
  297. package/dist/versioned/postgres/index.d.ts +11 -0
  298. package/dist/versioned/postgres/index.js +12 -0
  299. package/dist/versioned/postgres/index.js.map +1 -0
  300. package/dist/versioned/postgres/waits.d.ts +46 -0
  301. package/dist/versioned/postgres/waits.js +78 -0
  302. package/dist/versioned/postgres/waits.js.map +1 -0
  303. package/dist/versioned/report.d.ts +25 -0
  304. package/dist/versioned/report.js +84 -0
  305. package/dist/versioned/report.js.map +1 -0
  306. package/dist/versioned/stand-down.d.ts +30 -0
  307. package/dist/versioned/stand-down.js +56 -0
  308. package/dist/versioned/stand-down.js.map +1 -0
  309. package/dist/versioned/state.d.ts +108 -0
  310. package/dist/versioned/state.js +153 -0
  311. package/dist/versioned/state.js.map +1 -0
  312. package/package.json +61 -4
  313. package/schemas/apply.schema.json +269 -0
  314. package/schemas/common.schema.json +213 -0
  315. package/schemas/drift.schema.json +36 -0
  316. package/schemas/init.schema.json +31 -0
  317. package/schemas/lint-rules.schema.json +54 -0
  318. package/schemas/lint.schema.json +290 -0
  319. package/schemas/mcp.schema.json +70 -0
  320. package/schemas/new.schema.json +71 -0
  321. package/schemas/plan.schema.json +371 -0
  322. package/schemas/rebase.schema.json +54 -0
  323. package/schemas/repair.schema.json +20 -0
  324. package/schemas/status.schema.json +310 -0
@@ -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
+ }