the single-column FK edges of the MJ core schema (from EnumerateMjEntityFkGraph)
the provider's SQLDialect, used to quote identifiers ([x] vs. "x")
the MJ core schema name (e.g. __mj)
the predicate selecting the doomed Entity rows (already dialect-quoted)
Builds the FULL FK-dependent teardown for the doomed
Entityrows, 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 theEntityrows, thenSchemaInfo. 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.