An AI coding agent broke a database schema with six migrations and 400 lines of ALTERs
Comfortable-Roof4278 · reddit · 2026-07-23
A developer used an AI coding tool to speed up an internal dashboard, but the agent kept compounding database mistakes: a missed pagination issue became a chain of bad migrations, contradictory ALTERs, a dropped-and-recreated column with the wrong type, and even a circular foreign-key setup.
After scrapping the mess and rebuilding from the database’s current state, they switched to a stricter review loop: let AI draft tables or migrations, but never stack a new patch on top before reviewing the current state and diff. They also mention using Enter Pro’s Cloud database view to keep the real schema visible while rewriting migrations by hand.
More from coding & agent
- Claude Code’s CLAUDE.md is only context; hard rules need PreToolUse hooks — thisdudelikesAI · 2026-07-23
- Claude Code’s /context and /memory commands reveal which memory files are actually loaded — thisdudelikesAI · 2026-07-23
- Add Claude Code rules only after the same mistake shows up twice — thisdudelikesAI · 2026-07-23
- Claude Code’s auto memory writes project notes to disk and loads only the first 200 lines — thisdudelikesAI · 2026-07-23
- Claude Code supports @path imports in CLAUDE.md to reuse shared rules across repos — thisdudelikesAI · 2026-07-23
- Claude Code can load path-scoped rules from .claude/rules without extra context tax — thisdudelikesAI · 2026-07-23