The database company PlanetScale announced a new Rewind feature that will allow developers to roll back changes to data migrations to prevent downtime or data loss.

According to the company, it’s possible to make a schema change to a database that causes unexpected issues like downtime or a full-scale outage. Any data that gets added during the period in which the database was down has the potential to be lost.  

This new Rewind capability allows developers to revert schema changes in less than a minute, compared to the hours that it would previously take to fix it. 

Databases that are enrolled in PlanetScale’s limited beta will now see a “Revert changes” button that will stay active for 30 minutes after changes have been made. If selected, changes will be reverted immediately. 

As an example, if you were to remove a column and associated data, then revert that request with Rewind, the column and its data will reappear in a matter of seconds. 

“Rewind opens the door to a new level of velocity and power for your engineering team. Along with existing PlanetScale features such as 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,” Taylor Barnett, staff developer advocate at PlanetScale, wrote in a blog post