Change Impact Analysis
Computes blast radius for a migration: tables touched directly, and downstream tables reachable via FK relationships.
Pipeline
- A lightweight parser extracts table names following
FROM / JOIN / UPDATE / INTO / TABLE / ALTER TABLE. - The agent pulls the FK dependency graph from
information_schema. - BFS walks 2 hops (capped at 100 nodes) to enumerate dependents of the touched tables.
- The model classifies each downstream edge:
highwhen an FK constraint would be violated by the change,mediumfor indirect risk,lowfor 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.