Commit e180535
authored
fix: order platform saga query by version for deterministic migration (#1452)
* fix: order platform saga query by version for deterministic migration
loadPlatformSagas queries all platform_saga_definition rows and stores
them in a map keyed by name. When multiple versions exist (e.g.,
stripe_payment v1/v2/v3), the last row scanned overwrites the entry.
Without ORDER BY version, the winning version was non-deterministic,
causing migration tests to fail when an older version won and the
similarity check against the tenant's latest-version script dropped
below threshold (69% vs required 95%).
* fix: use semver-aware ordering for platform saga version selection
The version column is VARCHAR with semver format (X.Y.Z). Lexical
ordering would misorder multi-digit versions (1.10.0 < 1.2.0). Use
string_to_array with integer casting for correct numeric comparison.
---------
Co-authored-by: Ben Coombs <bjcoombs@users.noreply.github.com>1 parent 765be40 commit e180535
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | | - | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
416 | 419 | | |
417 | 420 | | |
418 | 421 | | |
| |||
0 commit comments