Libraries
    Preparing search index...

    Function entitiesToSnapshot

    • 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.

      Parameters

      • entities: Entity<any, any, never>[]

        The entities from your EntityMap.

      Returns SchemaSnapshot

      A snapshot reflecting the current code-first schema state.

      const snapshot = entitiesToSnapshot(Object.values(entityMap));
      writeSnapshot('./migrations/snapshot.json', snapshot);