# `mix trellis.dump`
[🔗](https://github.com/salesforce-misc/trellis/blob/v0.1.0-alpha/clients/elixir/lib/mix/tasks/trellis.dump.ex#L2)

Runs `mix ecto.dump` and appends the repo's Trellis definitions to the
structure file it wrote, so `mix ecto.load` builds a database that has
its transforms (see `Trellis.StructureDump`).

    mix trellis.dump [-r Repo] [-d path] [--prefix schema]

It takes `ecto.dump`'s options and passes them to it unchanged:
`-r`/`--repo`, `-d`/`--dump-path`, `--prefix` (repeatable) and
`-q`/`--quiet`. Make it what `mix ecto.dump` runs, by an alias in the
app's `mix.exs`:

    defp aliases do
      ["ecto.dump": "trellis.dump"]
    end

The definitions are read before and after the `pg_dump`, and the dump is
redone (up to three times) when a define or drop committed in between.

Every repo is dumped; the definitions are appended for each one with a
`:trellis` configuration (as `Trellis.Migration` reads it). A repo with
none is dumped as `ecto.dump` dumps it, and the task refuses to run when
no repo has one.

---

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