fix(db): sort the Postgres move's names with an explicit code-unit compare

Five sorts in the Postgres bootstrap and the move from SQLite relied on the
default sort, which SonarCloud reports as a bug because it compares by code
unit implicitly. They order migration names, table names and JSON keys for a
checksum, where locale-aware ordering would change the result, so each now
names the code-unit compare the default already used. Nothing changes.
This commit is contained in:
Maurice
2026-11-18 23:58:20 +01:00
parent daa4e1dfcf
commit 7ae4dcba51
4 changed files with 5 additions and 5 deletions
@@ -332,7 +332,7 @@ export function stableJson(text: string): string {
if (value !== null && typeof value === 'object') {
return Object.fromEntries(
Object.keys(value)
.sort()
.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0))
.map((key) => [key, sort((value as Record<string, unknown>)[key])]),
);
}