AI FEATURES

Applying AI-Suggested Fixes and Reviewing the Diff

Once you’ve reviewed the AI Analysis checklist and selected the items you want addressed — “select all” and “deselect all” act only on the currently filtered/visible tasks, so a filtered-out task is never silently included — the footer shows “N of M selected” and an Implement Selected Fixes button, disabled while nothing is selected.

What happens on click

Clicking it sends your current DDL plus only the selected tasks to /api/apply-fixes, which asks Gemini to rewrite the complete DDL addressing just those tasks while leaving everything else untouched. The response includes the rewritten DDL and a list of any fixes it couldn’t fully apply, each with a reason (for example, an orphan table it declined to touch without more context).

Reviewing the result

The result opens in a preview modal as a diff against your current DDL. If anything couldn’t be applied, it’s shown above the diff as a clearly marked “fixes not applied” list — one card per unresolved fix with its title and reason — rather than a single paragraph a skipped fix could get lost in.

You then choose:

  • Accept — re-parses the new DDL through the same path used elsewhere in the app, which preserves manual table positions, sticky notes, and expanded-column state for any table that didn’t change. The AI tab resets to idle so you can re-run analysis against the updated schema.
  • Discard — leaves your DDL exactly as it was; nothing is applied

This doesn’t save automatically

Accepting a fix updates the working DDL in your session — it does not persist to your account by itself. Use the top-bar Save button afterward, which will prompt the usual update-existing-vs-save-as-new confirmation if this is an existing saved schema. The DDL is also automatically reformatted once a fix is accepted, so the confirmation diff reflects the actual change rather than incidental whitespace noise.

ERD Factory

Schema visualization & analysis for people who ship databases.

© 2026 ERD Factory