NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #729 most downloaded on Packagist
Phinx makes it ridiculously easy to manage the database migrations for your PHP app.
Latest stable
0.16.12
Last release 4 months ago
03 Jul 2026
Release timing varies
gaps range from 2 weeks to 8 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
107 releases · first in 2012
Drag across the ruler to compare, or tap a release to open it.
Add native enum type support for postgresql by @ErfanMomeniii in https://github.com/cakephp/phinx/pull/2412
Full Changelog: https://github.com/cakephp/phinx/compare/0.16.11...0.16.12
Fix deprecations in phpstan config by @MasterOdin in https://github.com/cakephp/phinx/pull/2387
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Full Changelog: https://github.com/cakephp/phinx/compare/0.16.10...0.16.11
Add count option to migrate by @MasterOdin in https://github.com/cakephp/phinx/pull/2360
Full Changelog: https://github.com/cakephp/phinx/compare/0.16.9...0.16.10
Fix --dry-run option when values to insert are booleans by @JulienChavee in https://github.com/cakephp/phinx/pull/2358
Full Changelog: https://github.com/cakephp/phinx/compare/0.16.8...0.16.9
Fix performance degradation for bulk inserts by @MasterOdin in https://github.com/cakephp/phinx/pull/2354
Full Changelog: https://github.com/cakephp/phinx/compare/0.16.7...0.16.8
Support Cake\I18n\Date and DateTime for inserts by @dereuromark in https://github.com/cakephp/phinx/pull/2348
Full Changelog: https://github.com/cakephp/phinx/compare/0.16.6...0.16.7
Add deprecation warning for Util::mapClassNameToFileName by @MasterOdin in https://github.com/cakephp/phinx/pull/2327
:memory: in docs example by @piotr-cz in https://github.com/cakephp/phinx/pull/2335require without brackets by @piotr-cz in https://github.com/cakephp/phinx/pull/2337Full Changelog: https://github.com/cakephp/phinx/compare/0.16.5...0.16.6
Fix using schema option with connection option by @MasterOdin in https://github.com/cakephp/phinx/pull/2316
Full Changelog: https://github.com/cakephp/phinx/compare/0.16.4...0.16.5
fix warning in info when using connection config by @MasterOdin in https://github.com/cakephp/phinx/pull/2312
Full Changelog: https://github.com/cakephp/phinx/compare/0.16.3...0.16.4
Add dry-run option to seed:run by @MasterOdin in https://github.com/cakephp/phinx/pull/2299
PostgresAdapter::getGlobalSchemaName protected function has been removed. Use the PostgresAdapter::$schema class member variable instead.Full Changelog: https://github.com/cakephp/phinx/compare/0.16.2...0.16.3
Add migration version and name to pending actions error by @ajibarra in https://github.com/cakephp/phinx/pull/2289
Full Changelog: https://github.com/cakephp/phinx/compare/0.16.1...0.16.2
Option for addTimeStamps() to use datetime by @joshbmarshall in https://github.com/cakephp/phinx/pull/2273
Full Changelog: https://github.com/cakephp/phinx/compare/0.16.0...0.16.1
Validate datetime for version by @dereuromark in https://github.com/cakephp/phinx/pull/2249 When using AbstratMigration class, when it's instantiated,
AbstratMigration class, when it's instantiated, the version will be validated that it is 14 characters (YYYYMMDDHHmmSS). A future version may strengthen this to validate that it's a valid datetime. To get prior behavior, will need to extend the AbstractMigration class and either override the constructor or the new validateVersion method.hasPrimaryKey would return inconsistently if the passed array of columns was a subset/superset of actual primary keys. This function should now only return true iff the passed array of columns strictly matches the actual list of primary key columns (same length and values). Postgres and SQLServer are case sensitive, while MySQL and SQLite are case insensitive.Full Changelog: https://github.com/cakephp/phinx/compare/0.15.5...0.16.0
Introduce getQueryBuilder aliases for specific database actions by @wallacio in https://github.com/cakephp/phinx/pull/2242
Full Changelog: https://github.com/cakephp/phinx/compare/0.15.4...0.15.5
Correct type for migrate target option by @wallacio in https://github.com/cakephp/phinx/pull/2241
Note: Columns created in Sqlite before 0.15.4 using the PdoAdapter::PHINX_TYPE_BINARYUUID type were binary_blob. In 0.15.4 they were changed to be type uuid_blob. If you rely on this constant, you will need to manually update the types of any columns using PdoAdapter::PHINX_TYPE_BINARYUUID to the new value.
Note: binary(16) support for Sqlite inside CakePHP requires v5.0.3+.
Full Changelog: https://github.com/cakephp/phinx/compare/0.15.3...0.15.4
Fix using test command when manually setting config by @MasterOdin in https://github.com/cakephp/phinx/pull/2235
Full Changelog: https://github.com/cakephp/phinx/compare/0.15.2...0.15.3
Allow Table::addColumn() to use type from Column object again by @othercorey in https://github.com/cakephp/phinx/pull/2224
Full Changelog: https://github.com/cakephp/phinx/compare/0.15.1...0.15.2
Ensure PostgresAdapter::useIdentity is always initialized by @othercorey in https://github.com/cakephp/phinx/pull/2223
PostgresAdapter::useIdentity is always initialized by @othercorey in https://github.com/cakephp/phinx/pull/2223Full Changelog: https://github.com/cakephp/phinx/compare/0.15.0...0.15.1
We are still using 0.x releases as the API is not yet considered stable, as evidenced by the breaking change below.
Note: The 2.0.0, 2.0.1, and 2.0.2 tags were created incorrectly, and have been deleted and will be removed from packagist. This release features all of the same features and changes that was in those releases. We are still using 0.x releases as the API is not yet considered stable, as evidenced by the breaking change below.
This release requires PHP 8.1 or greater to be installed to use Phinx. As part of this, a number of type declarations were changed throughout Phinx to take advantage of the expanded syntax allowed by PHP 8.1. See https://github.com/cakephp/phinx/pull/2218 for all the files affected.
For users that overwrite $autoId in their migration class, this will now need a bool type declaration:
public bool $autoId = false;
In previous versions, Phinx was inconsistent with how it handled foreign keys across the adapters. Per https://github.com/cakephp/phinx/pull/2212, here is the old and new behaviors:
Currently the behavior looks like this:
MySQL Postgres Sqlite SQL Server Case-sensitive drop no yes yes no¹ Case-sensitive lookup yes yes no yes¹ Multi-column drop no² yes no³ no² Drop all column matches yes yes no yes Column order dependent drop no no no no Column order dependent lookup yes no no no Silently drop non-existent by columns no yes no yes Silently drop non-existent by name no no - no <sup>1) In a case sensitive database the query would produce an error.</sup> <sup>2) Generates duplicate drop instructions, one for every key that has any of the given columns.</sup> <sup>3) For every column, the first key that starts with that column would be deleted.</sup>
With these changes, the new behavior would be as follows:
MySQL Postgres Sqlite SQL Server Case-sensitive drop no yes¹ no yes¹ Case-sensitive lookup no yes¹ no yes¹ Multi-column drop yes yes yes yes Drop all column matches yes yes yes yes Column order dependent drop yes yes yes yes Column order dependent lookup yes yes yes yes Silently drop non-existent by columns no no no no Silently drop non-existent by name no no - no <sup>1) The behavior is independent of whether the database/column is actually case-sensitive.<sup>
Full Changelog: https://github.com/cakephp/phinx/compare/0.14.0...0.15.0
Require php-64bit to install phinx by @MasterOdin in https://github.com/cakephp/phinx/pull/2169
Full Changelog: https://github.com/cakephp/phinx/compare/0.13.4...0.14.0
Currently, there are two flags that opt out of breaking changes that were added in `0.13.0`, namely allowing to restore behavior of having primary key…
This release adds feature flags, which allows for toggling behavior of Phinx to better fit your workflow. Currently, there are two flags that opt out of breaking changes that were added in 0.13.0, namely allowing to restore behavior of having primary keys signed by default as well as making columns not null by default.
Full Changelog: https://github.com/cakephp/phinx/compare/0.13.3...0.13.4
Fix string to int return type by @dereuromark in https://github.com/cakephp/phinx/pull/2150
Full Changelog: https://github.com/cakephp/phinx/compare/0.13.2...0.13.3
Fix deprecated ${} string interpolation by @rigrig in https://github.com/cakephp/phinx/pull/2133
Full Changelog: https://github.com/cakephp/phinx/compare/0.13.1...0.13.2
Fix deprecation warning on return value for Config::offsetGet by @MasterOdin in #2117
0 if omitted when running migrate by @nrob81 in #2115Config::offsetGet by @MasterOdin in #2117Full Changelog: https://github.com/cakephp/phinx/compare/0.13.0...0.13.1
remove deprecated hasSchemaTable function from AdapterInterface by @MasterOdin in #1877
NOT NULL by default, and to now get that behavior, you will need to explicitly pass 'null' => false in the column options.$direction argument to preFlightCheck and postFlightCheck (use isMigratingUp property) by @MasterOdin in #1892utf8mb4 default charset and collation for new mysql tables by @MasterOdin in #1875 (Set charset and collation setting in phinx.php to utf8mb3 for prior behavior)$signed => false. To restore prior behavior, pass $signed => true when defining the default PK.up, down, or change methods for AbstractMigration. If you extend from phinx, you will need to add type hinting to your code)AdapterInterface by @MasterOdin in #1877insert, dropTable methods from MigrationInterface by @MasterOdin in #1878PostgresAdapter by @ajibarra in #2085 (identity columns for postgres 10+ will now be generated as INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY instead of SERIAL NOT NULL)default_migration_table config setting, use migration_table instead by @MasterOdin in #1961smallinteger on an identity column will now use the type smallserial)shouldExecute method to AbstractMigration and AbstractSeed by @AdrienPoupa in #1939SqlServerAdapter by @tedce in #1969$params argument to query/execute adapter methods to allow usage of prepared queries by @MasterOdin in #1962AbstractCommand::getMigrationTemplateFilename)Manager::getSeeds method)Full Changelog: https://github.com/cakephp/phinx/compare/0.12.13...0.13.0
Fix defaultName deprecation warning on symfony/console 6.1 by @MasterOdin in #2107
Full Changelog: https://github.com/cakephp/phinx/compare/0.12.12...0.12.13
Fix setting persistent option for PDO connection by @paulermo in https://github.com/cakephp/phinx/pull/2092
Full Changelog: https://github.com/cakephp/phinx/compare/0.12.11...0.12.12
Add full text search index GIN type by @antoniovj1 in https://github.com/cakephp/phinx/pull/2066
Full Changelog: https://github.com/cakephp/phinx/compare/0.12.10...0.12.11
Fixed setting default for Blob, Geometry, Json, and Text for MySQL 8+
smallint(5))--no-infoFixed renaming table not using prefix/suffix on new name
Fixes issue with MySQL Adapter primary key getter
hasPrimaryKey() method in Table object. This mirrors the existing hasForeignKey() function.int to bool and char to uuidfalse to ignore it in addTimestamps()/addTimestampsWithTimezone methods. This is useful if not both fields are used.Fixed error when creating a foreign key on a table without an autoincrementing primary key in SQLite
Add limit option for primary key migrations
Fix not being able to set limit on big integer for MySQL
Fixed adding columns to existing SQLite table with table constraints
decimal in SQLite adapterChanged migration template to adopt strict types and create migrations as final
Fixed issue around tinyint(1) and bool detection
Added binaryuuid column type support for Migration files.
binaryuuid column type support for Migration files.SRID for geometry columns for MySQL 8+Minimum of PHP 7.2 required now.
default_database is now default_environment.setDataDomain(), getDataDomain(), and getColumnForType() to adapters.NOT NULL by default, regardless if a default value for the column is specified or not. This brings it in line with how the other adapters work.Do not throw an exception for missing phinxlog for dry-run
symfony/yaml component again.Fixed an exception of 0.11.5 where no such exception was needed or warranted.
Fixed an exception of 0.11.5 where no such exception was needed or warranted.
Fixed schema table not being properly quoted in some queries
Included commits: https://github.com/cakephp/phinx/compare/0.11.3...0.11.4
Included commits: https://github.com/cakephp/phinx/compare/0.11.3...0.11.4
Removed composer.json version number to allow normal release/tagging. Fixes previously broken patch release.
Removed composer.json version number to allow normal release/tagging. Fixes previously broken patch release.
Fixed minimum versions of dependencies #1592
$defaultName instead of COMMAND_NAME in command classes. #1596[Postgres] Fix truncate table (#1555, #1474)
--set and --unset options for breakpoints (#1560)Several bug fixes introduced in 0.10 related to the batching of alter table statements
LIMIT on CHAR typed columns (#1518)getColumns() (#1466)Fixed wrong SQL used when adding new columns to a table in SQLite
Table::getColumn() methodFixed boolean fields couldn't have default NULL
Fixed issues in the Postgresql adapter that would drop the wrong foreign keys when only using column names
-v flag. The debugging output referring to the list of files visited by phinx during a migration roll out can still be viewed using -vvvImproved the warnings when declaring both the change and any of up or down methods in a migration.
change and any of up or down methods in a migration.up() and down() methods were removed fro the MigrationInterfaceDeprecated AbstractMigration::dropTable()
.sqlite3change() method and any of up() and down as wellAbstractMigration::dropTable()AbstractMigration::insert()dropTable() method in the Migration class, it was broken in the previous release. Additionally deprecated the method as it is an alias for $this->table($table)->dropTable()->save(). Using the table method is preferred as it gives phinx the opportunity to buffer all actions and execute the at the end after validating them.This release is a major breaking change when coming from v0.9.x. Most of the user facing methods in the Migration class stay the same, some of the lea…
This release is a major breaking change when coming from v0.9.x. Most of the user facing methods in the Migration class stay the same, some of the least used ones are gone. The internals of Phinx have been severely changed, to make room for more features and to create more efficient queries.
SELECT, UPDATE, INSERT and DELETE queriesschema support for PostgresROW_FORMAT table optionLIMIT for each column in an indexLiteral expression0.9.2 (Saturday, 23 December 2017)
0.9.2 (Saturday, 23 December 2017)
0.9.1 (Satruday, 9 September 2017)
0.9.0 (Sunday, 3rd September 2017)
0.9.0 (Sunday, 3rd September 2017)
seed:run, insert all data to a table in a bulk0.8.1 (Monday, 5th June 2017) * Documentation updates * Pull requests * #768 Support for MySQL unsigned primary keys * #1104 Removed support for HHVM
0.8.1 (Monday, 5th June 2017)
0.8.0 (Tuesday, 28th February 2017)
0.8.0 (Tuesday, 28th February 2017)
Phinx 0.8 allows for phinx rollback and phinx status to operate on migrations in reverse execution order, rather than reverse creation order. To achieve this new ordering, you will need to add a new entry in your phinx.yml file (or equivalent).
The setting is called version_order and supports 2 values:
creation - this is the default value and matches the standard behaviour of executing rollbacks in the reverse order based upon the creation datetime (also known as version).execution - this is the new value and will execute rollbacks in the reverse order in which they were applied.This feature will be of most importance when development of migrations takes place in different branches within a codebase and are merged in to master for deployment. It will no longer matter when the migrations were created if it becomes necessary to rollback the migrations.
0.7.2 (Tuesday, 28th February 2017)
- Documentation updates - New features - #978 Add table truncate method - Pull requests - #1029 Add vendor to Phinx path to align with other docs
One column per quarter.