Seeds a temp PGlite with representative cross-table data (users, teams, team_members, conversations, messages), runs mosaic storage migrate-tier against a live federated PG+pgvector profile, asserts exact row counts and spot-checks key columns. Gated by FEDERATED_INTEGRATION=1. Caught and fixed P0 bug in migrate-tier: PostgresMigrationTarget passed Drizzle-selected camelCase keys (emailVerified, userId, ...) verbatim as SQL identifiers, failing on Postgres which expects snake_case. The 32 unit tests missed this because both source and target were mocked. normaliseSourceRow now applies toSnakeCase conversion that is idempotent on already-snake_case keys. Test infrastructure: - packages/storage/src/test-utils/pglite-with-vector.ts: PGlite + @electric-sql/pglite/vector (JS-native pgvector) and migration runner. Co-located with storage tests rather than exposed on @mosaicstack/db public surface (would have polluted prod consumers with WASM bundle). - packages/storage now declared "type": "module" (codebase convention, required for import.meta.url in test-utils). afterAll cleanup deletes prefix-namespaced rows even on test panic. Refs #460
492 KiB
492 KiB