laravel-mysql-to-postgres

laravel-mysql-to-postgres is a skill for Claude Code, Codex from majdghithan/agent-skills. It costs 104 tokens per session (1,409 once invoked), scanned A, original, MIT.

A guide for moving a Laravel application's database from MySQL or MariaDB to PostgreSQL. PostgreSQL is a database system that enforces some rules more strictly than MySQL, so the migration includes checking application assumptions as well as transferring data.

In plain words
What is it for?
Planning and carrying out MySQL-to-PostgreSQL migrations, testing Laravel migrations on a fresh PostgreSQL database, moving data, and preparing a safer database cutover.
Why use it?
Data conversion alone may not reveal queries, schema definitions, or application logic that depended on MySQL's more forgiving behaviour. This helps find those incompatibilities before and during the changeover.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Planning and carrying out MySQL-to-PostgreSQL migrations, testing Laravel migrations on a fresh PostgreSQL database, moving data, and preparing a safer database cutover.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/majdghithan/agent-skills/laravel-mysql-to-postgres
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add majdghithan/agent-skills --skill laravel-mysql-to-postgres
Clone the repo
git clone --depth 1 https://github.com/majdghithan/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for laravel-mysql-to-postgres

README.md
[![agentmods](https://agentmods.dev/badge/skills/majdghithan/agent-skills/laravel-mysql-to-postgres/github.svg)](https://agentmods.dev/skills/majdghithan/agent-skills/laravel-mysql-to-postgres)
Your own site
<a href="https://agentmods.dev/skills/majdghithan/agent-skills/laravel-mysql-to-postgres"><img src="https://agentmods.dev/badge/skills/majdghithan/agent-skills/laravel-mysql-to-postgres/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for laravel-mysql-to-postgres

Your own site · 80×15
<a href="https://agentmods.dev/skills/majdghithan/agent-skills/laravel-mysql-to-postgres"><img src="https://agentmods.dev/badge/skills/majdghithan/agent-skills/laravel-mysql-to-postgres.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 104 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,409 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00104 $0.01409
Opus 5 $0.00052 $0.00705
Sonnet 5 $0.00021 $0.00282
Haiku 4.5 $0.00010 $0.00141

Measured 11d ago against content hash 760a5dd3b94f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

laravel-mysql-to-postgres scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/laravel-mysql-to-postgres/SKILL.md · 82 lines

How it starts

The opening of the file, as written. The whole thing — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Laravel: MySQL -> PostgreSQL migration

The data moves fine. What breaks is the assumptions your app baked in over the years, because MySQL is forgiving and Postgres is strict. Every place you leaned on MySQL being lenient is a bug waiting on the other side. Treat a migration as an audit of your app's lazy assumptions, not a data transfer.

Step 0 - The one test that surfaces half the problems

Before touching real data, point php artisan migrate at a fresh empty Postgres database and watch what throws. If every migration runs clean, your schema is genuinely database-agnostic. If it throws, you just found your MySQL-only assumptions for free.

# .env pointed at an empty pgsql db
php artisan migrate:fresh   # does the schema even build on Postgres?

Do not delete MySQL the day you switch. Keep it running for days/weeks until you're sure - cutovers get reverted.

Step 1 - Move the data (pick one)

  • pgloader - a single tool built for exactly this. Reads MySQL, writes Postgres, converting types as it goes (TINYINT(1) -> boolean, AUTO_INCREMENT -> sequence). One command, most of the job. Usually resets sequences for you (see the trap below).
  • Laravel's query builder - read from the old connection, write to the new one in PHP, transforming rows. More control, more code; good when the schema has corners pgloader trips on. Does NOT reset sequences - you must do it manually.

The behavior differences that silently break Laravel

1. Search stops matching (case sensitivity) - the big one for any app with search

MySQL's default collation is case-INsensitive; Postgres is case-SENSITIVE.

// Worked on MySQL ('iphone' matched 'iPhone'), silently returns nothing on Postgres:
Product::where('name', 'LIKE', "%{$q}%")->get();
// Fix - case-insensitive LIKE:
Product::where('name', 'ILIKE', "%{$q}%")->get();
// Heavy search: the citext extension, or a functional index on LOWER(name).

Audit every product search, "find by email", and user-typed filter.

Read the full file on GitHub · 82 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 82 lines · 104 tokens per session scan A 760a5dd3b94f

Subscribe to this mod's changes

laravel-mysql-to-postgres is a skill published in the GitHub repository majdghithan/agent-skills (7 stars, last pushed 1mo ago), licensed MIT. It adds 104 tokens to every session and 1,409 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

database-optimizer

Optimizes database queries and improves performance across PostgreSQL and MySQL systems. Use when investigating slow queries, analyzing execution plans, or optimizing database performance. Invoke for index design, query rewrites, configuration tuning, partitioning strategies, lock contention resolution.

Jeffallan/claude-skills · 54 tokens

postgres-pro

Use when optimizing PostgreSQL queries, configuring replication, or implementing advanced database features. Invoke for EXPLAIN analysis, JSONB operations, extension usage, VACUUM tuning, performance monitoring.

Jeffallan/claude-skills · 41 tokens

postgres-database-migration

Use this skill for planning, testing, and safely executing PostgreSQL schema migrations — especially when working with production data or shared databases. Trigger when user asks to: Test a schema migration before applying it to production Add, remove, or rename columns safely on a live table Change a column's data…

timescale/pg-aiguide · 220 tokens

setup-timescaledb-hypertables

Use this skill when creating database schemas or tables for Timescale, TimescaleDB, TigerData, or Tiger Cloud, especially for time-series, IoT, metrics, events, or log data. Use this to improve the performance of any insert-heavy table. Trigger when user asks to: Create or design SQL schemas/tables AND…

timescale/pg-aiguide · 219 tokens

design-postgis-tables

Comprehensive PostGIS spatial table design reference covering geometry types, coordinate systems, spatial indexing, and performance patterns for location-based applications.

timescale/pg-aiguide · 31 tokens

migrate-postgres-tables-to-hypertables

Use this skill to migrate identified PostgreSQL tables to Timescale/TimescaleDB hypertables with optimal configuration and validation. Trigger when user asks to: Migrate or convert PostgreSQL tables to hypertables Execute hypertable migration with minimal downtime Plan blue-green migration for large tables Validate…

timescale/pg-aiguide · 181 tokens