What problem does it solve?
Migrating a Ruby on Rails application from MySQL to PostgreSQL requires handling type conversions, data transfer, zero-downtime cutover, and query behavior changes correctly to avoid data loss, broken functionality, or service interruption.
Core Features & Use Cases
- Bulk data migration guidance: Step-by-step instructions for using pgloader to transfer data with correct type casts for TINYINT to BOOLEAN, JSON to JSONB, and datetime to timestamptz, plus handling MySQL-specific edge cases like zero dates.
- Zero-downtime cutover pattern: Dual-write cutover workflow to migrate production databases without downtime, including verification steps and primary database swap procedures.
- Schema upgrade best practices: Guidance to leverage Postgres-exclusive features like GIN indexes for JSONB, CHECK constraints for ActiveRecord enums, partial indexes, and ILIKE for case-insensitive queries, instead of just translating MySQL schema verbatim.
- Use Case: A team running a production Rails e-commerce platform on MySQL can use this skill to migrate to Postgres while avoiding common pitfalls like duplicate key errors from unreset sequences or broken user search queries from case-sensitivity changes.
Quick Start
Use the db-migration-mysql-postgres skill to plan and execute a zero-downtime migration of your Rails application's primary database from MySQL to PostgreSQL, including schema upgrades and pgloader-based data transfer.