claude-code - 💡(How to fix) Fix [MODEL] generated a migration that dropped a column without explicit instruction, on a live database.

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Code Example



---

Claude Sonnet 4.6
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues for similar behavior reports
  • This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude made incorrect assumptions about my project

What You Asked Claude to Do

I Asked: to change the relation from "one to one" to "one to many"

What Claude Actually Did

generated a migration that dropped a column without explicit instruction, on a live database, with no data migration step confirmed first.

Expected Behavior

cluade should not add drop scripts for columns, tables or database with other tasks. unless claude was instructed to do so, Or claude could ask when it sees that task requires dropping.

Files Affected

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Haven't tried to reproduce

Steps to Reproduce

  1. Have an existing database with a column that holds live data (site_action.demolition_officer_id)
  2. Ask Claude to refactor the relationship — change a one-to-one FK to a many-to-many via a new join table
  3. Claude generates a Flyway migration that: - Creates the new tables ✓ - Immediately issues ALTER TABLE site_action DROP COLUMN demolition_officer_id ✗ - No data migration step before the drop - No warning to the user - No confirmation requested
  4. Migration runs, column is gone, existing data is lost

Claude Model

Sonnet

Relevant Conversation

Claude Sonnet 4.6

Impact

Critical - Data loss or corrupted project

Claude Code Version

● Claude Code 2.1.119

Platform

Anthropic API

Additional Context

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [MODEL] generated a migration that dropped a column without explicit instruction, on a live database.