惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Proofpoint News Feed
宝玉的分享
宝玉的分享
人人都是产品经理
人人都是产品经理
博客园_首页
爱范儿
爱范儿
博客园 - 叶小钗
aimingoo的专栏
aimingoo的专栏
S
SegmentFault 最新的问题
MyScale Blog
MyScale Blog
阮一峰的网络日志
阮一峰的网络日志
IT之家
IT之家
Microsoft Security Blog
Microsoft Security Blog
Blog — PlanetScale
Blog — PlanetScale
博客园 - 【当耐特】
Y
Y Combinator Blog
量子位
博客园 - 三生石上(FineUI控件)
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
The Blog of Author Tim Ferriss
月光博客
月光博客
有赞技术团队
有赞技术团队
Apple Machine Learning Research
Apple Machine Learning Research
A
About on SuperTechFans

Blog — PlanetScale

Keeping a Postgres queue healthy — PlanetScale Patterns for Postgres Traffic Control — PlanetScale Graceful degradation in Postgres — PlanetScale High memory usage in Postgres is good, actually — PlanetScale Stripe Projects partnership: Provision PlanetScale Postgres and MySQL databases from the Stripe CLI — PlanetScale Enhanced tagging in Postgres Query Insights — PlanetScale Behind the scenes: How Database Traffic Control works — PlanetScale Introducing Database Traffic Control — PlanetScale Scaling Postgres connections with PgBouncer — PlanetScale Drizzle joins PlanetScale — PlanetScale Video Conferencing with Postgres — PlanetScale Faster PlanetScale Postgres connections with Cloudflare Hyperdrive — PlanetScale Introducing the PlanetScale MCP server — PlanetScale Database Transactions — PlanetScale Automating our changelog with Cursor commands — PlanetScale Postgres 18 is now available — PlanetScale Using MotherDuck with PlanetScale — PlanetScale $50 PlanetScale Metal is GA for Postgres — PlanetScale AI-Powered Postgres index suggestions — PlanetScale $5 PlanetScale is live — PlanetScale Announcing Vitess 23 — PlanetScale $50 PlanetScale Metal — PlanetScale Report on our investigation of the 2025-10-20 incident in AWS us-east-1 — PlanetScale $5 PlanetScale — PlanetScale Benchmarking Postgres 17 vs 18 — PlanetScale Larger than RAM Vector Indexes for Relational Databases — PlanetScale Partnering with Cloudflare to bring you the fastest globally distributed applications — PlanetScale Processes and Threads — PlanetScale PlanetScale for Postgres is now GA — PlanetScale Postgres High Availability with CDC — PlanetScale
Revert a migration without losing data — PlanetScale
Taylor Barnett · 2022-03-24 · via Blog — PlanetScale

Taylor Barnett |

Bad migrations happen every day and data loss can be devastating. PlanetScale’s new schema revert feature gives you the power to revert changes after a schema migration with no downtime and zero data loss.

What is it?

Have you ever made a schema change, like changing a column’s data type or dropping a table, that broke your production application causing unplanned downtime, or even worse, a full-scale outage? And once it was live, you immediately wished you could go back in time, without losing any data that was added during the broken period?

Your wish has come true. PlanetScale’s new schema revert feature allows you to revert a migration with zero data loss.

This feature enables something never possible before: The ability to revert your database’s schema changes in less than a minute with the press of a button with no downtime or data loss. Previously, if you dropped the wrong index, running a new migration might take you a few hours to fix. Even worse, if you dropped the wrong column or table and had to restore from a backup, it would take days or weeks to roll out. And what happens to your data and your application while it is being fixed?

Schema reverts open the door to a new level of velocity and power for your engineering team. Along with existing PlanetScale features such as Database Branching and Deploy Requests, you can make changes (and fix changes) in your database faster and safer than before. It not only saves you time, but it makes schema changes less scary because you can treat your database like you treat your code. Unless you built custom in-house tooling for your database, these workflows have not been possible before.

How does it work?

After you have completed a deploy request, you will be able to revert to a clean state of the database before the schema changes. This includes any data that may have been removed in the deploy request. Any database enrolled in the limited beta will see a “Revert changes” button available on the relevant deploy request page for 30 minutes after the changes have been deployed. Once the “Revert changes” button is selected, it is deployed immediately.

For example, if you remove a column and its associated data in a deploy request, and then revert it, your column and its associated data will appear again in seconds.

This is possible because of VReplication in Vitess, the database clustering and management system that powers PlanetScale databases alongside MySQL. Vitess' VReplication also powers features like Database Imports. VReplication uses a lossless sync in the background between valid states of the database. It copies data from the source to the destination table in a consistent fashion. VReplication's implementation is unique because it allows us to go down to the MySQL transaction level, ensuring no data is lost and that your database schema returns to its previous state before the schema change. All in just seconds.

For a more in-depth look at how this works, take a look at the Behind the scenes: how schema reverts work blog post.

Want to see it in action?

Sign up for the limited beta to test it out yourself! Sign up or log into PlanetScale and opt into the limited beta in your database’s Settings tab. In the Beta features section, select “Enroll this database in the schema revert limited beta.” Once you create a database branch with changes to your schema, deploy the deploy request, and then revert!

For more information, check out our Deploy requests – Revert a schema change documentation.