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.

Original post →

More from coding & agent

coding & agent channel →