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

Empties a projection's table and replays every stored event into it, in order.

    mix vic.projection.rebuild MyApp.Projections.ListSummary
    mix vic.projection.rebuild MyApp.Projections.ListSummary MyApp.Projections.Other

Use it after fixing an `on` clause, or after adding a projection for events that already
happened. The events must still be in `domain_events`. Readers see the table fill up again
while it runs, so run it in a quiet period; if it fails part-way the projection is partial
and the task says so and exits non-zero: fix the cause and run it again.

Each projection is rebuilt on its own: a failure in one does not stop the others.

---

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