feat(db): idempotent startup normalizer rewriting List values to native JSON

This commit is contained in:
Joseph Doherty
2026-06-16 17:50:19 -04:00
parent e3d804a1a6
commit f4b101b532
3 changed files with 360 additions and 0 deletions
@@ -47,6 +47,12 @@ public static class MigrationHelper
"Apply migrations using 'dotnet ef database update' or the generated SQL scripts before starting in production mode.");
}
}
// Safety-net normalizer: rewrite any already-persisted List attribute values from the
// old array-of-strings JSON form to the new native-typed form. Idempotent and never
// aborts startup for data reasons (per-row skip + log). Safe even if both central
// nodes run it concurrently on startup.
await ListValueNormalizer.NormalizeAsync(dbContext, logger, cancellationToken);
}
private static async Task WaitForDatabaseReadyAsync(