# `mix phoenix_kit.gen.migration`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v2.32.1/lib/mix/tasks/phoenix_kit.gen.migration.ex#L1)

Generate a PhoenixKit versioned migration for the parent application.

Scans existing migrations in `priv/repo/migrations/` to determine the current
PhoenixKit version, then generates a migration that upgrades to the latest version.

## Usage

    mix phoenix_kit.gen.migration

## Options

  * `--prefix` - Database schema prefix. When omitted, resolves from
    `config :phoenix_kit, :prefix`, then defaults to "public" (validated:
    `[a-z_][a-z0-9_]*`). The generated migration passes
    `create_schema: true` only for a fresh install (no prior PhoenixKit
    migration in the project) with a non-public prefix.

## Examples

    # Generate upgrade migration with default prefix
    mix phoenix_kit.gen.migration

    # Generate with custom schema prefix
    mix phoenix_kit.gen.migration --prefix my_schema

---

*Consult [api-reference.md](api-reference.md) for complete listing*
