Incident Library

IL-0577 Ficilcom · 2026-09-25 (published)database

Ficilcom's production Neon PostgreSQL database was reset by prisma migrate reset meant for the local database

Ficilcom builds its product with Turborepo, Prisma and Neon (PostgreSQL). The database code lives in packages/database, and the same Prisma commands run against whatever the DATABASE_URL in that folder's .env points to, local or production; nothing guarded against this, and nothing checked that the URL was localhost before migrate reset. Before the holidays the engineer had run a migration against production and left the production DATABASE_URL in packages/database/.env. After the holidays the engineer did not remember this and ran the reset without checking, which reset the production database.

The engineer found Neon's Backup & Restore feature and used it to restore the database. On the Launch plan in use, the history window is 1 day by default and up to 7 days, and the history reached back one day, so the data could be recovered. The service was stopped for about an hour. The service was in its early launch phase with one customer's data, and access logs showed almost no impact.

Severity
–
Scope
The production database was reset and the service stopped for about an hour
Users affected
One customer's data was in the database; access logs showed almost no impact
Region
–
Time to detect
–
Time to resolve
1h

Symptoms

On the first working day after the Silver Week holidays, an engineer ran prisma migrate reset and then loaded seed data, intending to clean the local database before resuming work. The seed data did not seem to be there, and the engineer first suspected that the coding agent had skipped the step. The reset had in fact run against the production database.

Symptom Data loss

Root cause

Root cause Operator error

Component Database
Trigger
The engineer ran prisma migrate reset believing it targeted the local database, while packages/database/.env still held the production DATABASE_URL left there from a production migration before the holidays.

Detection

After the reset the engineer saw that the seed data did not seem to be present and realised the reset had hit production.

Remediation

Action items

Lessons

Memory after a long holiday cannot be trusted, so the state of unfinished work has to be written down instead. A destructive command should refuse to run when its target is not clearly local. That a backup feature exists does not mean the plan's history window is long enough, and the damage was small this time only because the service happened to be at an early stage.

Sources

References

Related cases

Check your cluster for this

kubegap audits a Kubernetes cluster for conditions like the ones in this case, Database among them, read-only, from Claude Code or Codex. Its checks cite public reports like this one.

For AI tools and scripts

The API needs no key. The MCP server offers search_incidents, get_incident, list_incidents, get_topic and vocab; both are explained on API and MCP.