What problem does it solve?
Migrating a Ruby on Rails application from PostgreSQL to MySQL introduces significant risk due to Postgres-specific schema features like JSONB columns, ARRAY data types, partial indexes, and custom sequences, which can break queries, lose functionality, or cause data corruption if not handled correctly during migration.
Core Features & Use Cases
- Pre-migration schema audit: Catalog all Postgres-specific features in your existing schema to identify required rewrites before migration.
- Bulk data and schema migration: Use pgloader to transfer schema and data in a single step, with built-in type casting for common Postgres-to-MySQL conversions.
- Zero-downtime cutover: Implement a dual-write pattern to sync data between Postgres and MySQL during the transition, with verification steps to ensure data consistency before flipping the primary database.
- Postgres feature rewrite guidance: Get explicit instructions for converting JSONB queries to MySQL JSON functions, replacing ARRAY columns with join tables, and adapting partial indexes to MySQL's generated column syntax.
Use case: A Rails team forced to switch to MySQL for compliance or hosting requirements can use this skill to avoid breaking existing application functionality and eliminate downtime during the cutover.
Quick Start
Use the db-migration-postgres-mysql skill to plan and execute a zero-downtime migration of your Rails application's database from PostgreSQL to MySQL, including schema auditing, bulk data transfer, and production cutover.