`pgroll migrate --squash`
Author: richardgillCreated Mar 13, 2025Updated May 27, 2026
pgroll migrate seems to apply migrations one at a time starting and completing them in sequence.
This is useful locally when spinning up a new dev environment. But means pgroll migrate is only useful for deployments if there is 1 new migration to apply.
First idea: pgroll migrate --single which fails if there is more than one migration. This allows me to use all the nice things about pgroll migrate but not accidentally lose the benefits pgroll schemas give me by applying multiple migrations in sequence.
Second idea: pgroll migrate --squash which applys all unapplied migrations in a single step (this seems hard), but would be essential for certain deployment workflows. E.g. staging -> prod once a week.
Source: xataio/pgroll