Phinx is a database migration tool for PHP that lets you version-control and manage schema changes through database-agnostic PHP code.
Phinx solves the problem of tracking and applying database schema changes across environments without embedding SQL directly in your codebase. You write migrations as PHP classes that describe changes in a database-neutral way, then execute them to migrate your schema up or down. The tool handles the mechanics of tracking which migrations have run and applying only the pending ones, while also supporting data seeding after schema creation.
Phinx suits any PHP project that needs repeatable, version-controlled database changes—from small applications to large deployments. It works standalone without requiring a full framework or ORM, making it easy to integrate into existing codebases. The tool supports MySQL, PostgreSQL, SQLite, and Microsoft SQL Server. One known limitation is that PostgreSQL does not support setting unique constraints on tables through Phinx.
The project maintains steady activity with regular updates to its codebase. Documentation is comprehensive and available on the project website, with community translations provided. The tool can be installed via Composer or run as a standalone Phar archive, giving flexibility in how it integrates into deployment workflows.