jackc / tern

The SQL Fan's Migrator
MIT License
850 stars 66 forks source link

Fix unsorted migrations bug #65

Closed rafabulsing closed 1 year ago

rafabulsing commented 1 year ago

Implemented following the discussion at #62.

The underlying issue was that FindMigrationsEx would not work if files in migrations directory were not properly sorted (say, 1 through 10 without padding 0s).

This PR fixes that. The function still identifies if migrations are missing/repeated. It also returns the paths sorted in the expected order (regardless of padding 0s).

jackc commented 1 year ago

LGTM. Thanks!

rafabulsing commented 1 year ago

Nice, it was my pleasure! ☺