Skip to content

Fix/natural postgres migration order - #65

Open
MahanMzi-git wants to merge 2 commits into
mj-hahn:mainfrom
MahanMzi-git:fix/natural-postgres-migration-order
Open

MahanMzi-git wants to merge 2 commits into
mj-hahn:mainfrom
MahanMzi-git:fix/natural-postgres-migration-order

Conversation

@MahanMzi-git

@MahanMzi-git MahanMzi-git commented Nov 12, 2026 •

Copy link
Copy Markdown

Fixes PostgreSQL migration ordering by sorting migration filenames naturally instead of lexicographically.

Previously, numbered migrations could execute in the wrong order (for example, 10_ before 2_), potentially causing schema migration failures.

$changes

  • Added a natural sorting key for migration filenames.
  • Updated _migration_files to sort migration files numerically.
  • Added tests covering plain numbered migrations and timestamped migrations.

$tests

  • tests/test_postgres.py: 32 tests passed.
  • Both newly added migration ordering tests passed.

@MahanMzi-git
MahanMzi-git deleted the fix/natural-postgres-migration-order branch November 12, 2026 16:09
@MahanMzi-git
MahanMzi-git restored the fix/natural-postgres-migration-order branch November 12, 2026 16:11
@MahanMzi-git MahanMzi-git reopened this Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant