Laravel MySQL → PostgreSQL schema risk check
Paste SHOW CREATE TABLE output, a mysqldump --no-data file, or Laravel migration files. You get the things that break on Postgres, most dangerous first. Runs in your browser; nothing is uploaded.
Get the schema: mysqldump --no-data your_db > schema.sql or SHOW CREATE TABLE users\G
Already moved and seeing errors? Paste your Postgres error, get the fix. Raw SQL to convert? MySQL → Postgres SQL translator.
What it checks
- int / smallint unsigned: Postgres has no unsigned types; Laravel makes them integer / smallint, so values above 2,147,483,647 (or 32,767) fail with "out of range".
- bigint unsigned above 2^63-1.
- AUTO_INCREMENT: sequences stay at 1 after a bulk copy, and the first insert fails with "duplicate key value violates unique constraint".
- TIMESTAMP columns: a default dump writes UTC, so on a non-UTC server values shift by hours. Row counts still match.
- _ci collations on email/username/slug: comparisons and unique indexes become case-sensitive.
- tinyint(1) → boolean: raw
WHERE col = 1fails with "operator does not exist: boolean = integer". - ENUM, SET, YEAR, ZEROFILL, JSON stored as longtext (MariaDB), binary → bytea, spatial types.
- Zero dates (
DEFAULT '0000-00-00'), ON UPDATE CURRENT_TIMESTAMP, VIRTUAL generated columns (Postgres 17 and older: STORED only). - Prefix indexes like
KEY (bio(50)), FULLTEXT, MyISAM tables (orphan rows break foreign keys). - Laravel migrations:
increments(),unsignedInteger(),timestamps(),enum(),set(),useCurrentOnUpdate(), MySQL collations, and backticks in raw SQL.
Schema only. Data problems (zero dates in rows, NUL bytes, tinyint(1) = 2, values already over 2^31, case-duplicate emails) need a look at the data: use the free read-only PHP checker (one file, MIT) against your MySQL database.
Each rule was tested on MariaDB 11.8 and Postgres 17 with Laravel 13. The tool is pattern-based, so treat it as a checklist, not proof.