diff --git a/docs/src/content/docs/commands/list.mdx b/docs/src/content/docs/commands/list.mdx index c17dedb..1a037fe 100644 --- a/docs/src/content/docs/commands/list.mdx +++ b/docs/src/content/docs/commands/list.mdx @@ -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] -``` + + + ```bash + npx emigrate list [options] + ``` + + + ```bash + pnpm exec emigrate list [options] + ``` + + + ```bash + yarn exec emigrate -- list [options] + ``` + + + ```json {3} + { + "scripts": { + "emigrate": "emigrate list [options]" + } + } + ``` + + ## Options diff --git a/docs/src/content/docs/commands/new.mdx b/docs/src/content/docs/commands/new.mdx index 48ca2be..b6132ee 100644 --- a/docs/src/content/docs/commands/new.mdx +++ b/docs/src/content/docs/commands/new.mdx @@ -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] -``` + + + ```bash + npx emigrate new [options] + ``` + + + ```bash + pnpm exec emigrate new [options] + ``` + + + ```bash + yarn exec emigrate -- new [options] + ``` + + + ```json {3} + { + "scripts": { + "emigrate": "emigrate new [options] " + } + } + ``` + + ## Arguments diff --git a/docs/src/content/docs/commands/remove.mdx b/docs/src/content/docs/commands/remove.mdx index dca59ae..5fafd2c 100644 --- a/docs/src/content/docs/commands/remove.mdx +++ b/docs/src/content/docs/commands/remove.mdx @@ -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] -``` + + + ```bash + npx emigrate remove [options] + ``` + + + ```bash + pnpm exec emigrate remove [options] + ``` + + + ```bash + yarn exec emigrate -- remove [options] + ``` + + + ```json {3} + { + "scripts": { + "emigrate": "emigrate remove [options] " + } + } + ``` + + ## Arguments diff --git a/docs/src/content/docs/commands/up.mdx b/docs/src/content/docs/commands/up.mdx index 78aea06..17012b8 100644 --- a/docs/src/content/docs/commands/up.mdx +++ b/docs/src/content/docs/commands/up.mdx @@ -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] -``` + + + ```bash + npx emigrate up [options] + ``` + + + ```bash + pnpm exec emigrate up [options] + ``` + + + ```bash + yarn exec emigrate -- up [options] + ``` + + + ```json {3} + { + "scripts": { + "emigrate": "emigrate up [options]" + } + } + ``` + + ## Options