mix vic.projection.rebuild (vicander v0.1.1)

Copy Markdown View Source

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.