Skip to content

Commit f72b4fc

Browse files
Merge pull request cmdscale#23 from cmdscale/fix/#15_instable_operation_order
fix: use stable sort for migration operations (fixes cmdscale#15)
2 parents c106b10 + 5326eac commit f72b4fc

File tree

2 files changed

+832
-3
lines changed

2 files changed

+832
-3
lines changed

src/Eftdb/Internals/TimescaleMigrationsModelDiffer.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ public override IReadOnlyList<MigrationOperation> GetDifferences(IRelationalMode
3737
}
3838

3939
// Sort the entire list based on the priority defined in the helper method
40-
allOperations.Sort((op1, op2) => GetOperationPriority(op1).CompareTo(GetOperationPriority(op2)));
41-
42-
return allOperations;
40+
List<MigrationOperation> sortedOperations = [.. allOperations.OrderBy(GetOperationPriority)];
41+
return sortedOperations;
4342
}
4443

4544
/// <summary>

0 commit comments

Comments
 (0)