# `mix vic.gen.migration`
[🔗](https://github.com/blackuprise/vicander/blob/v0.1.1/lib/mix/tasks/vic.gen.migration.ex#L1)

Generates the Ecto migration for an aggregate stored by `DDD.Repository.Ecto`.

    mix vic.gen.migration MyApp.Order
    mix vic.gen.migration MyApp.Order --rename title:name
    mix vic.gen.migration MyApp.Order --allow-destructive

The first run writes `create table`. Later runs compare the aggregate with the
snapshot in `priv/ddd_snapshots/` and write only the difference as a new migration.

Options:

  * `--table`             - table name (first run only; default derived from the module)
  * `--rename old:new`    - treat a column as renamed, keeping its data (repeatable)
  * `--allow-destructive` - allow removing a column or changing its type
  * `--repo`              - repo module for the migration name (default: the configured repo)
  * `--snapshot-dir`, `--migrations-path` - override the default directories

---

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