PlanetScale

Zero downtime Rails migrations with the PlanetScale Rails gem

Mar 20, 2023Mike Coutermarsh
Zero downtime Rails migrations with the PlanetScale Rails gem
SummaryAI, from the source post

This post introduces the `planetscale_rails` gem, which provides Rake tasks for managing Rails schema migrations with PlanetScale databases. It details a workflow for zero-downtime migrations by separating schema and code deployments, leveraging PlanetScale deploy requests and branches. It outlines safe patterns for common migration scenarios like adding, removing, and renaming columns, and adding/removing indexes, and also covers handling data migrations via production console scripts or dedicated Ruby classes.

More from the Database Branching and Blue/Green Deployments trail