API version: 0.3.0

---

# `migration:generate`

Generates migrations which apply the schemas to the database, see [`POST /migration`](/api/post-migration.md). Without an
argument all schemas are checked, schemas whose database is up to date are skipped.

Arguments and options:

- `type` - only generate the migration of this node label or relation type.
- `--queue` - queues the generated migrations, so that the next `migration:run` executes them.
- `--dry-run` - only prints the steps which the migrations would have.

## Help

```bash
php bin/console migration:generate --help
```

```text
Description:
  Generates migrations which apply the schemas to the database; they are run with migration:run.

Usage:
  migration:generate [options] [--] [<type>]

Arguments:
  type                  Name of the type whose schema is migrated, all schemas if omitted.

Options:
      --queue           Queues the generated migrations, so that the next migration:run executes them.
      --dry-run         Only prints the steps which the migrations would have.
  -h, --help            Display help for the given command. When no command is given display help for the list command
      --silent          Do not output any message
  -q, --quiet           Only errors are displayed. All other output is suppressed
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -e, --env=ENV         The Environment name. [default: "prod"]
      --no-debug        Switch off debug mode.
      --profile         Enables profiling (requires debug).
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
```

## Example

```bash
php bin/console migration:generate User --dry-run
```

```text
    ▄
  ▄▀ ▀▄  Ember Nexus API
   ▀█▀   v0.3.0, production mode

  Migration generate

  User
    - Create a range index on property 'email'.
    - Create the Elasticsearch index 'node_user' with the mapping of the schema.
▶ Dry run, nothing was generated.
```

---

Home: [Ember Nexus API docs](/index.md)

Full site map: [llms.txt](/llms.txt)

Previous: [mphf:build](/command/mphf-build.md)

Next: [migration:listen](/command/migration-listen.md)
