Zero downtime Rails migrations with the PlanetScale Rails gem
Mar 20, 2023Mike Coutermarsh

Summary
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.