Skip to content

Migration Conflict when the Migration File Version Numbers Jump #1011

@xqi-aviatrix

Description

@xqi-aviatrix

Hello,

 We encounter a migration conflict issue recently. Here is our setup
 We have migration files under `postgres_migrations` 
```
0001_aaa.sql
0002_bbb.sql
0003_ccc.sql
0004_ddd.sql
0005_eee.sql
0006_fff.sql
0007_ggg.sql
0008_hhh.sql
0009_jjj.sql
0021_kkk.sql
```

when goose run the migrations we get migration conflict error

...
Error: could not create backing store: could not run Up migrations: error: found 1 missing migrations before current version 21:
        version 9: postgres_migrations/0009_jjj.sql
...

Does the latest version number need to exactly one plus the previous version number in order to avoid migration conflict?
I cannot find any related document about this migration conflict.
Any insights would be appreciated.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions