Summary
columnsAreDifferent compares type/nullable/default/unique/enum but never col.references. Adding, removing, or changing a FK target or onDelete/onUpdate on an existing column produces no diff, so generateDiffSql emits nothing.
Evidence (repro)
belongsTo: ['User'] -> belongsTo: [{ model:'User', onDelete:'cascade' }] => "-- No changes detected"Location
src/migrations.ts:~895-917.
Suggested fix
Compare references (table/column/onDelete/onUpdate) in columnsAreDifferent and emit addForeignKey/drop-constraint statements on diff. (SQLite can't ALTER ... ADD CONSTRAINT — needs the table-rebuild path or a documented limitation.)
Severity: medium/high. Found via internal code audit.