Menu

1 / 2

Tests pass but the agent dropped a column: what a green diff can still contain

DEV Community: database·hwu121380-afk·2 days ago
#N1q7LQyA
#devtodatabase#devto#dev#grep#delete
Reading 0:00
15s threshold

If you let Claude Code, Codex or Cursor write a migration, you've probably seen a PR that's all green: tests pass, CI is happy. Tests usually run against a fresh database, so they rarely notice a change that deletes data. A dropped column, a DELETE with no WHERE , or rm -rf $OUT_DIR/ can sit in a diff that looks routine.

Here are the patterns I watch for, and the cheap checks I use for each one. You can do all of this with git, a grep, and (if you're on Rails) a free gem.

1. The migration drops or renames something

Here are the kind of lines that look routine in a migration:

remove_column :users , :email

Enter fullscreen mode

Exit fullscreen mode

DROP TABLE sessions ; ALTER TABLE orders DROP COLUMN total ;

Enter fullscreen mode

Exit fullscreen mode

Django, Alembic, Knex, Laravel, Sequelize and Prisma can all do the same thing in their own dialects.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.