db-migration-postgres-mysql

Community

Safely migrate Rails databases from Postgres to MySQL.

Authorsandeepmvl
Version1.0.0
Installs0

System Documentation

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.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: db-migration-postgres-mysql
Download link: https://github.com/sandeepmvl/rails-skills/archive/main.zip#db-migration-postgres-mysql

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 536,000+ vetted skills library on demand.