Skip to content

Commit a8ab934

Browse files
authored
Add documentation for create subcommand (#820)
This PR adds documentation for the new subcommand `create`. ![Screenshot 2025-05-09 at 09-42-35 pgroll - Zero-downtime reversible schema changes for PostgreSQL](https://github.com/user-attachments/assets/1ad4426b-87c4-4969-b307-a80265b515bd)
1 parent 34c19af commit a8ab934

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

docs/cli/create.mdx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Create
3+
description: Create migration files interactively
4+
---
5+
6+
## Command
7+
8+
```
9+
$ pgroll create
10+
```
11+
12+
This command helps you generate `pgroll` migrations interactively, and saves the file to disk in YAML format.
13+
14+
The optional `--name` flag can be used to specify the name of the migration.
15+
16+
The optional `--empty` flag can be used to generate empty migration files.
17+
18+
The optional `--json` flag can be used to write migration files in JSON.
19+
20+
If both `--name` and `--empty` flags are set, the command does not prompt you for anything. So it can be used to generate initialize new migrations from scripts.
21+
22+
23+
### Examples
24+
25+
#### Generate empty YAML migrations
26+
27+
```
28+
pgroll create --name my_migration --empty
29+
```
30+
31+
#### Generate empty JSON migrations
32+
33+
```
34+
pgroll create --name my_migration --empty --json
35+
```
36+
37+
<Warning>
38+
The generated migration files are not validated. It is possible that depending on the user input, the command produces invalid migrations. For example, required fields might not be set. Please, always validate the generated migration file.
39+
</Warning>

docs/config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@
7474
"href": "/cli/rollback",
7575
"file": "docs/cli/rollback.mdx"
7676
},
77+
{
78+
"title": "Create",
79+
"href": "/cli/create",
80+
"file": "docs/cli/create.mdx"
81+
},
7782
{
7883
"title": "Status",
7984
"href": "/cli/status",

0 commit comments

Comments
 (0)