Skip to content

postgres/migration-order

Checks that every migration has a version, that no two share one, and that a new migration sorts after the committed ones.

Part of the postgres configuration, at the recommended level. It runs at the commit stage, once per scope. gspot runs this check itself.

A migration that sorts before an applied one never runs on databases already past it.

Rename the new migration with a version later than the newest committed one.

A new migration numbered below the latest committed one reports a finding. Give it a later version, and leave applied migrations unchanged.

Turn it off for some files, with a reason:

gspot ignore postgres/migration-order --paths "<glob>" --reason "<why>"