Build a SchemaSnapshot from a set of entities without a live DB.
Handles polymorphic (CTI) entities by including each variant table. Deduplicates tables so STI variants sharing a base table are only included once.
The entities from your EntityMap.
EntityMap
A snapshot reflecting the current code-first schema state.
const snapshot = entitiesToSnapshot(Object.values(entityMap));writeSnapshot('./migrations/snapshot.json', snapshot); Copy
const snapshot = entitiesToSnapshot(Object.values(entityMap));writeSnapshot('./migrations/snapshot.json', snapshot);
Build a SchemaSnapshot from a set of entities without a live DB.
Handles polymorphic (CTI) entities by including each variant table. Deduplicates tables so STI variants sharing a base table are only included once.