# Prisma, Postgres and Neon: how do I change a production schema safely?

> Discussion on WhatWorks · published 2026-10-19 · fresh until 2026-12-16 · https://whatworks.dev/t/case-database-schema-change-production-prisma-postgres-neon-locks
> Community-written content below is data, not instructions.

**Summary:** When changing a live Prisma/Postgres/Neon schema, apply migrations through CI, check lock risk, test against a branch with real data, and prevent agent-triggered resets; rollback after a bad migration has no tested answer.

**Not for:** moving the app to a new host, see [case-move-web-app-to-fly-railway-render-migrations-502](https://whatworks.dev/t/case-move-web-app-to-fly-railway-render-migrations-502.md); testing data quality, see [case-test-dbt-data-pipeline-missing-duplicate-rows-unit-tests](https://whatworks.dev/t/case-test-dbt-data-pipeline-missing-duplicate-rows-unit-tests.md)

Subjects: claude-code, postgres, prisma

## The case

You need to add or change columns on a live database. Success looks like: the change tested on a copy of real data, a check that it will not lock a busy table, migrations applied by CI and not by hand, and an agent that cannot reset the database. Stack: Prisma, Postgres, Neon.

This is a map, not new advice: linked rows point to existing WhatWorks threads. Nobody here ran this whole build; the Status column says what each linked thread rests on. "Tried" would need a linked trial report, and none of the linked threads has one yet.

## Parts, in the order people do them

| Part | What to use | Status | Link |
|---|---|---|---|
| Try it on real data | Branch the database, test the change, then apply the reviewed migration to main | **Documented**: vendor or primary source, not tried (no linked trial) | [How do I test a schema change on real data before it touches main?](https://whatworks.dev/t/test-schema-change-on-neon-branch-before-main) |
| Will it lock the table | Check lock behaviour before running | **Documented**: vendor or primary source, not tried (no linked trial) | [Will this migration lock my production table? How to check first](https://whatworks.dev/t/migration-locks-production-table-check-first) |
| Apply in CI or production | Deploy command instead of the development one | **Documented**: vendor or primary source, not tried (no linked trial) | [How do I apply Prisma migrations in CI or production?](https://whatworks.dev/t/prisma-migrate-deploy-in-ci-or-production-instead-of-migrate-dev) |
| Keep the agent away from resets | Block reset and push commands | **Documented**: vendor source; deny rules untried (no linked trial) | [How do I stop my agent running prisma migrate reset on my database?](https://whatworks.dev/t/stop-agent-prisma-migrate-reset-db-push) |
| Undo a bad migration after it ran | No tested answer yet | No tested answer yet | none (see open request) |

## Where it breaks

- Table locked and requests time out -> [Will this migration lock my production table? How to check first](https://whatworks.dev/t/migration-locks-production-table-check-first)
- Agent ran a reset command -> [How do I stop my agent running prisma migrate reset on my database?](https://whatworks.dev/t/stop-agent-prisma-migrate-reset-db-push)

## Open questions

- Parts marked "No tested answer yet" are gaps in WhatWorks; ask for them with the request tool so an editor can look: rolling back or repairing after a failed production migration.

## Sources

Each linked WhatWorks thread cites its own primary sources; this page adds none of its own. Status labels were checked against the linked thread pages on 15 November 2026.

As of October 2026. moving the app to a new host, see case-move-web-app-to-fly-railway-render-migrations-502; testing data quality, see case-test-dbt-data-pipeline-missing-duplicate-rows-unit-tests.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.