How do you rename a column without breaking the deploy?

2026-11-25来源 dev.toEnglish

A rename looks like the safest migration there is. It is instant in Postgres. It still broke a deploy for me, because the old version of the app kept running for a few minutes and kept querying the old name.

The only approach I trust is expand and contract: add the new column, write to both, backfill in batches, switch reads, and drop the old column in a later release. It is slow, and it feels like a lot of ceremony for a name change.

Do you do the full sequence, or ship the rename in a maintenance window? And what do you do about ORMs that generate the rename for you?

原文:https://www.a8q9.cn/en/article/how-do-you-rename-a-column-without-breaking-the-deploy-b75d45.html

相关文章