-
Notifications
You must be signed in to change notification settings - Fork 106
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Migration file ordering is broken when pulling migrations with explicit name
fields that differ from the the filename.
Description
When using explicit names in migration files, the pgroll pull
command breaks the ordering of migrations.
Steps to reproduce
- Create migrations directory with two files:
01_create_table.yml
(without explicit name)02_create_another_table.yml
(with explicit name: "00_oops")
- Run
pgroll migrate migrations/ --complete
to apply them - Run
pgroll pull tmp/
Actual behaviour
The migration from migrations/02_create_another_table.yml
is pulled to tmp/00_oops
, breaking the ordering as it now comes before 01_create_table
.
Expected behaviour
The ordering of migrations should be preserved when pulling migrations, regardless of explicit naming.
Reproduction migrations
# 01_create_table.yml
operations:
- create_table:
name: customers
columns:
- name: id
type: integer
pk: true
# 02_create_another_table.yml
name: 00_oops
operations:
- create_table:
name: products
columns:
- name: id
type: serial
pk: true
Relates to #715
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working