Change Impact Analysis

Computes blast radius for a migration: tables touched directly, and downstream tables reachable via FK relationships.

Pipeline

  1. A lightweight parser extracts table names following FROM / JOIN / UPDATE / INTO / TABLE / ALTER TABLE.
  2. The agent pulls the FK dependency graph from information_schema.
  3. BFS walks 2 hops (capped at 100 nodes) to enumerate dependents of the touched tables.
  4. The model classifies each downstream edge: high when an FK constraint would be violated by the change, medium for indirect risk, low for tracking.

Output

{
  affectedTables: ['schema.table'...],
  downstream: [
    { table: 'schema.dependent', via: 'fk', risk: 'low' | 'medium' | 'high' }
  ],
  summary: '1-2 sentences on overall blast radius'
}

Boundaries

Only FK edges are walked today, view and trigger dependencies are not yet traversed. Multi-statement scripts that recreate objects in sequence may double-count tables.