docs: update all command docs with package manager variants
This commit is contained in:
parent
1fc24269f4
commit
445fe69e60
4 changed files with 112 additions and 12 deletions
|
|
@ -3,6 +3,8 @@ title: "`emigrate list`"
|
|||
description: "List migrations and their status."
|
||||
---
|
||||
|
||||
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
|
||||
The `list` command is used to list _all_ migrations, i.e. both already run migrations and migrations that haven't been run yet.
|
||||
|
||||
Emigrate takes all migration files in the given directory that haven't been run yet and all migrations from the migration history.
|
||||
|
|
@ -10,9 +12,32 @@ It then sorts the migrations by filename in ascending order and outputs them and
|
|||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
emigrate list [options]
|
||||
```
|
||||
<Tabs>
|
||||
<TabItem label="npm">
|
||||
```bash
|
||||
npx emigrate list [options]
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="pnpm">
|
||||
```bash
|
||||
pnpm exec emigrate list [options]
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="yarn">
|
||||
```bash
|
||||
yarn exec emigrate -- list [options]
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="package.json">
|
||||
```json {3}
|
||||
{
|
||||
"scripts": {
|
||||
"emigrate": "emigrate list [options]"
|
||||
}
|
||||
}
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Options
|
||||
|
||||
|
|
|
|||
|
|
@ -3,15 +3,40 @@ title: "`emigrate new`"
|
|||
description: "Create new migration."
|
||||
---
|
||||
|
||||
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
|
||||
The `new` command is used to create a new migration file in the given directory.
|
||||
|
||||
The migration file can be based on a template, generated by a [generator plugin](/plugins/generators/), or just be an empty file.
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
emigrate new [options] <name>
|
||||
```
|
||||
<Tabs>
|
||||
<TabItem label="npm">
|
||||
```bash
|
||||
npx emigrate new [options] <name>
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="pnpm">
|
||||
```bash
|
||||
pnpm exec emigrate new [options] <name>
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="yarn">
|
||||
```bash
|
||||
yarn exec emigrate -- new [options] <name>
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="package.json">
|
||||
```json {3}
|
||||
{
|
||||
"scripts": {
|
||||
"emigrate": "emigrate new [options] <name>"
|
||||
}
|
||||
}
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Arguments
|
||||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,38 @@ title: "`emigrate remove`"
|
|||
description: "Remove a migration from the history."
|
||||
---
|
||||
|
||||
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
|
||||
The `remove` command is used to remove a migration from the history. This is useful if you want to retry a migration that has failed.
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
emigrate remove [options] <name>
|
||||
```
|
||||
<Tabs>
|
||||
<TabItem label="npm">
|
||||
```bash
|
||||
npx emigrate remove [options] <name>
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="pnpm">
|
||||
```bash
|
||||
pnpm exec emigrate remove [options] <name>
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="yarn">
|
||||
```bash
|
||||
yarn exec emigrate -- remove [options] <name>
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="package.json">
|
||||
```json {3}
|
||||
{
|
||||
"scripts": {
|
||||
"emigrate": "emigrate remove [options] <name>"
|
||||
}
|
||||
}
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Arguments
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ title: "`emigrate up`"
|
|||
description: "Run migrations"
|
||||
---
|
||||
|
||||
import { Tabs, TabItem } from '@astrojs/starlight/components';
|
||||
|
||||
The `up` command is used to either list or run all pending migrations, i.e. migrations that haven't been run yet.
|
||||
|
||||
Emigrate takes all migration files in the given directory and compares them to the migration history so that it knows which migrations are pending.
|
||||
|
|
@ -12,9 +14,32 @@ If any of the migrations fail, the command will be aborted and the rest of the m
|
|||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
emigrate up [options]
|
||||
```
|
||||
<Tabs>
|
||||
<TabItem label="npm">
|
||||
```bash
|
||||
npx emigrate up [options]
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="pnpm">
|
||||
```bash
|
||||
pnpm exec emigrate up [options]
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="yarn">
|
||||
```bash
|
||||
yarn exec emigrate -- up [options]
|
||||
```
|
||||
</TabItem>
|
||||
<TabItem label="package.json">
|
||||
```json {3}
|
||||
{
|
||||
"scripts": {
|
||||
"emigrate": "emigrate up [options]"
|
||||
}
|
||||
}
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Options
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue