# 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.

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`](/reference/configurations/postgres/) configuration, at the `recommended` [level](/start/concepts/#levels). It runs at the `commit` [stage](/start/concepts/#stage), once per scope. gspot runs this check itself.

## Why

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

## What to do

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

## Example

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

Turn it off for some files, with a reason:

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