Member Junction
    Preparing search index...
    • Builds the FULL FK-dependent teardown for the doomed Entity rows, deepest-first. PURE — no DB.

      Recursively clears all of Entity's FK-dependents via set-based DELETE (NOT-NULL FK → the row can't exist without the entity → delete + recurse into ITS dependents) or UPDATE … SET NULL (nullable FK → the row stands alone → unlink, no recursion, so shared objects like Conversation/User survive). Then the Entity rows, then SchemaInfo. Each level is scoped by a nested subquery rooted at the doomed entities. Self-refs (nullable → unlink; NOT NULL → covered by the table's own set-delete) and cross-table cycles (path guard) are handled.

      Parameters

      • fkEdges: FkEdge[]

        the single-column FK edges of the MJ core schema (from EnumerateMjEntityFkGraph)

      • dialect: SQLDialect

        the provider's SQLDialect, used to quote identifiers ([x] vs. "x")

      • mjSchema: string

        the MJ core schema name (e.g. __mj)

      • rootDoomedPredicate: string

        the predicate selecting the doomed Entity rows (already dialect-quoted)

      Returns TeardownPlan