forked from xataio/pgroll
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli-definition.json
More file actions
333 lines (333 loc) · 8.53 KB
/
cli-definition.json
File metadata and controls
333 lines (333 loc) · 8.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
{
"name": "pgroll",
"commands": [
{
"name": "analyze",
"short": "Analyze the SQL schema of the target database",
"use": "analyze",
"hidden": true,
"example": "",
"flags": [],
"subcommands": [],
"args": []
},
{
"name": "baseline",
"short": "Create a baseline migration for an existing database schema",
"use": "baseline <version> <target directory>",
"example": "",
"flags": [
{
"name": "json",
"shorthand": "j",
"description": "output in JSON format instead of YAML",
"default": "false"
},
{
"name": "yes",
"shorthand": "y",
"description": "skip confirmation prompt",
"default": "false"
}
],
"subcommands": [],
"args": [
"version",
"directory"
]
},
{
"name": "complete",
"short": "Complete an ongoing migration with the operations present in the given file",
"use": "complete <file>",
"example": "",
"flags": [],
"subcommands": [],
"args": []
},
{
"name": "convert",
"short": "Convert SQL statements to a pgroll migration",
"use": "convert <path to file with migrations>",
"example": "",
"flags": [
{
"name": "json",
"shorthand": "j",
"description": "Output migration file in JSON format instead of YAML",
"default": "false"
}
],
"subcommands": [],
"args": [
"migration-file"
]
},
{
"name": "create",
"short": "Create a new migration interactively",
"use": "create",
"example": "",
"flags": [
{
"name": "empty",
"shorthand": "e",
"description": "Create empty migration file",
"default": "false"
},
{
"name": "json",
"shorthand": "j",
"description": "Output migration file in JSON format instead of YAML",
"default": "false"
},
{
"name": "name",
"shorthand": "n",
"description": "Migration name",
"default": ""
}
],
"subcommands": [],
"args": []
},
{
"name": "init",
"short": "Initialize pgroll in the target database",
"use": "init <file>",
"example": "",
"flags": [],
"subcommands": [],
"args": []
},
{
"name": "latest",
"short": "Print the name of the latest schema version or migration",
"use": "latest",
"example": "",
"flags": [],
"subcommands": [
{
"name": "migration",
"short": "Print the latest migration name",
"use": "migration",
"example": "latest migration --local ./migrations",
"flags": [
{
"name": "local",
"shorthand": "l",
"description": "retrieve the latest migration from a local migration directory",
"default": ""
}
],
"subcommands": [],
"args": []
},
{
"name": "schema",
"short": "Print the latest version schema name",
"use": "schema",
"example": "latest schema --local ./migrations",
"flags": [
{
"name": "local",
"shorthand": "l",
"description": "retrieve the latest version from a local migration directory",
"default": ""
}
],
"subcommands": [],
"args": []
},
{
"name": "url",
"short": "Print a database connection URL for the latest schema version",
"use": "url",
"example": "pgroll latest url <connection-string> --local ./migrations",
"flags": [
{
"name": "local",
"shorthand": "l",
"description": "retrieve the latest schema version from a local migration directory",
"default": ""
}
],
"subcommands": [],
"args": [
"connection-string"
]
}
],
"args": []
},
{
"name": "migrate",
"short": "Apply outstanding migrations from a directory to a database",
"use": "migrate <directory>",
"example": "migrate ./migrations",
"flags": [
{
"name": "backfill-batch-delay",
"description": "Duration of delay between batch backfills (eg. 1s, 1000ms)",
"default": "0s"
},
{
"name": "backfill-batch-size",
"description": "Number of rows backfilled in each batch",
"default": "1000"
},
{
"name": "complete",
"shorthand": "c",
"description": "complete the final migration rather than leaving it active",
"default": "false"
},
{
"name": "expect-one",
"description": "Abort if there is more than one migration to be applied",
"default": "false"
}
],
"subcommands": [],
"args": [
"directory"
]
},
{
"name": "pull",
"short": "Pull migration history from the target database and write it to disk",
"use": "pull <target directory>",
"example": "",
"flags": [
{
"name": "json",
"shorthand": "j",
"description": "output each migration in JSON format instead of YAML",
"default": "false"
}
],
"subcommands": [],
"args": [
"directory"
]
},
{
"name": "rollback",
"short": "Roll back an ongoing migration",
"use": "rollback",
"example": "",
"flags": [],
"subcommands": [],
"args": []
},
{
"name": "start",
"short": "Start a migration for the operations present in the given file",
"use": "start <file>",
"example": "",
"flags": [
{
"name": "backfill-batch-delay",
"description": "Duration of delay between batch backfills (eg. 1s, 1000ms)",
"default": "0s"
},
{
"name": "backfill-batch-size",
"description": "Number of rows backfilled in each batch",
"default": "1000"
},
{
"name": "complete",
"shorthand": "c",
"description": "Mark the migration as complete",
"default": "false"
},
{
"name": "skip-validation",
"shorthand": "s",
"description": "skip migration validation",
"default": "false"
}
],
"subcommands": [],
"args": [
"file"
]
},
{
"name": "status",
"short": "Show pgroll status",
"use": "status",
"example": "",
"flags": [],
"subcommands": [],
"args": []
},
{
"name": "update",
"short": "Update outdated migrations in a directory",
"use": "update <directory>",
"example": "update ./migrations",
"flags": [
{
"name": "json",
"shorthand": "j",
"description": "Output migration file in JSON format instead of YAML",
"default": "false"
}
],
"subcommands": [],
"args": [
"directory"
]
},
{
"name": "validate",
"short": "Validate a migration file",
"use": "validate <file>",
"example": "validate migrations/03_my_migration.yaml",
"flags": [],
"subcommands": [],
"args": [
"file"
]
}
],
"flags": [
{
"name": "lock-timeout",
"description": "Postgres lock timeout in milliseconds for pgroll DDL operations",
"default": "500"
},
{
"name": "pgroll-schema",
"description": "Postgres schema to use for pgroll internal state",
"default": "pgroll"
},
{
"name": "postgres-url",
"description": "Postgres URL",
"default": "postgres://postgres:postgres@localhost?sslmode=disable"
},
{
"name": "role",
"description": "Optional postgres role to set when executing migrations",
"default": ""
},
{
"name": "schema",
"description": "Postgres schema to use for the migration",
"default": "public"
},
{
"name": "use-version-schema",
"description": "Create version schemas for each migration",
"default": "true"
},
{
"name": "verbose",
"description": "Enable verbose logging",
"default": "false"
}
]
}