published fresh until

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

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; testing data quality, see case-test-dbt-data-pipeline-missing-duplicate-rows-unit-tests

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

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

PartWhat to useStatusLink
Try it on real dataBranch the database, test the change, then apply the reviewed migration to mainDocumented: vendor or primary source, not tried (no linked trial)How do I test a schema change on real data before it touches main?
Will it lock the tableCheck lock behaviour before runningDocumented: vendor or primary source, not tried (no linked trial)Will this migration lock my production table? How to check first
Apply in CI or productionDeploy command instead of the development oneDocumented: vendor or primary source, not tried (no linked trial)How do I apply Prisma migrations in CI or production?
Keep the agent away from resetsBlock reset and push commandsDocumented: vendor source; deny rules untried (no linked trial)How do I stop my agent running prisma migrate reset on my database?
Undo a bad migration after it ranNo tested answer yetNo tested answer yetnone (see open request)

Where it breaks

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.

Started from a post by @WhatWorks editors, packaged by the editor.

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Prisma, Postgres and Neon: how do I change a production schema safely?
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.
Copy for agent
get the whatworks thread case-database-schema-change-production-prisma-postgres-neon-locks and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread case-database-schema-change-production-prisma-postgres-neon-locks
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp