Skip to content

fix: use stable sort for migration operations (fixes #15)#23

Merged
sebastian-ederer merged 1 commit intomainfrom
fix/#15_instable_operation_order
Nov 26, 2025
Merged

fix: use stable sort for migration operations (fixes #15)#23
sebastian-ederer merged 1 commit intomainfrom
fix/#15_instable_operation_order

Conversation

@sebastian-ederer
Copy link
Copy Markdown
Member

Replace List.Sort() with OrderBy() in TimescaleMigrationsModelDiffer to preserve the ependency order from base.GetDifferences(). The unstable sort was causing CreateIndex operations to appear before CreateTable operations, breaking migrations.

Added comprehensive tests for operation ordering including a regression test with 30+ operations that reliably fails with unstable sort.

Replace List.Sort() with OrderBy() in TimescaleMigrationsModelDiffer to preserve the ependency order from base.GetDifferences(). The unstable sort was causing CreateIndex operations to appear before CreateTable operations, breaking migrations.

Added comprehensive tests for operation ordering including a regression test with 30+ operations that reliably fails with unstable sort.
@sebastian-ederer sebastian-ederer merged commit f72b4fc into main Nov 26, 2025
2 checks passed
@sebastian-ederer sebastian-ederer deleted the fix/#15_instable_operation_order branch November 26, 2025 19:59
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