NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #1240 most downloaded on Packagist
Database Migration plugin for CakePHP
Latest stable
5.2.6
Last release 3 months ago
29 Jul 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
118 releases · first in 2015
Drag across the ruler to compare, or tap a release to open it.
Add command descriptions to migration commands by @markstory in https://github.com/cakephp/migrations/pull/1109
Full Changelog: https://github.com/cakephp/migrations/compare/5.2.5...5.2.6
Track the plugin of executed seeds in cake_seeds by @dereuromark in https://github.com/cakephp/migrations/pull/1107
Full Changelog: https://github.com/cakephp/migrations/compare/5.2.4...5.2.5
Make the database adapter available inside shouldExecute() by @dereuromark in https://github.com/cakephp/migrations/pull/1100
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Full Changelog: https://github.com/cakephp/migrations/compare/5.2.3...5.2.4
Auto-generate check constraint name when name is empty by @dereuromark in https://github.com/cakephp/migrations/pull/1098
Full Changelog: https://github.com/cakephp/migrations/compare/5.2.2...5.2.3
Do not auto-increment composite primary key columns in bake migration. Baking a join-table migration with a composite integer primary key (e.g. articl
article_id:integer:primary tag_id:integer:primary) generated autoIncrement on both columns, which MySQL rejects. Now autoIncrement is only emitted for a single integer primary key. (#1095)Full Changelog: https://github.com/cakephp/migrations/compare/5.2.1...5.2.2
Quote the constraint name in the MySQL DROP FOREIGN KEY statement. Names that are not bare identifiers previously produced invalid SQL — whitespace in
DROP FOREIGN KEY statement. Names that are not bare identifiers previously produced invalid SQL — whitespace in a name (cakephp/phinx#924) or numeric names auto-assigned by MariaDB 12.x (DROP FOREIGN KEY 1) would fail with a syntax error. The identifier is now quoted via quoteColumnName(), matching the Postgres and SQL Server adapters.Full Changelog: https://github.com/cakephp/migrations/compare/5.2.0...5.2.1
Add an --all flag to the migrations status command
--all flag to the migrations status command (#1076)citext column type support for PostgreSQL (#1069)gist, spgist, brin, hash (#1053)Full Changelog: https://github.com/cakephp/migrations/compare/5.1.1...5.2.0
TestSuite\Migrator now treats cake_migrations as a migration metadata table alongside legacy *_phinxlog tables, so the unified migration ledger is res
TestSuite\Migrator now treats cake_migrations as a migration metadata table alongside legacy *_phinxlog tables, so the unified migration ledger is reset during test cleanup instead of being left behind. (#1072)Full Changelog: 5.1.0...5.1.1
Add support for database views and triggers.
Full Changelog: 5.0.4...5.1.0
improve error message if a migration contains the old base migration class by @LordSimal in https://github.com/cakephp/migrations/pull/1059
Full Changelog: https://github.com/cakephp/migrations/compare/5.0.3...5.0.4
Stop using deprecated setOnDelete/setOnUpdate methods by @dereuromark in https://github.com/cakephp/migrations/pull/1047
Foreign Key Constraint Naming: When using addForeignKey() without an explicit constraint name, migrations now auto-generates names using the pattern {table}_{columns} instead of letting the database generate names (e.g., articles_ibfk_1 on MySQL). This provides consistent naming across all database adapters but may affect rollbacks in existing migrations that reference constraints by their old names. See the upgrade documentation for details.
Full Changelog: https://github.com/cakephp/migrations/compare/5.0.2...5.0.3
Fix migrations upgrade with postgres which has native booleans by @nicosp in https://github.com/cakephp/migrations/pull/1023
Full Changelog: https://github.com/cakephp/migrations/compare/5.0.1...5.0.2
Fix dump command error when migrations directory does not exist by @dereuromark in https://github.com/cakephp/migrations/pull/1009
Full Changelog: https://github.com/cakephp/migrations/compare/5.0.0...5.0.1
Fully refactored major with zero dependencies outside CakePHP code.
Fully refactored major with zero dependencies outside CakePHP code.
'signed' => false for unsigned columnscake_migrations table name (auto-detects legacy phinxlog for BC)cake_seeds table, preventing accidental re-runsinsertOrUpdate() and insertOrSkip() methods for seedspartitionBy()ALGORITHM and LOCK options for zero-downtime schema changesCURRENT_DATE, CURRENT_TIME, etc. as defaultsUsers instead of UsersSeed everywherebin/cake seeds run User instead of --seed User--fake flag - Mark seeds as executed without running themFor details see docs and migration guide.
Full Changelog: https://github.com/cakephp/migrations/compare/4.9.4...5.0.0
pin phinx to 0.16.10 as 0.16.11 contains breaking changes by @LordSimal in #1078
This release fixes a problem related to changes introduced in Phinx 0.16.11.
ℹ️ If you are on CakePHP 5.3+ we HIGHLY recommend you upgrade to Migrations v5. Go to https://book.cakephp.org/migrations/5/upgrades/upgrading-from-4-x.html to learn what has changed and what you need to do, to get it working ℹ️
Full Changelog: 4.9.6...4.9.7
Add runtime deprecation warnings for AbstractMigration and AbstractSeed by @dereuromark in https://github.com/cakephp/migrations/pull/1006
Full Changelog: https://github.com/cakephp/migrations/compare/4.9.5...4.9.6
Backport bug fixes from 5.x branch by @dereuromark in https://github.com/cakephp/migrations/pull/1005
Full Changelog: https://github.com/cakephp/migrations/compare/4.9.4...4.9.5
Fix small binary column creation by @markstory in https://github.com/cakephp/migrations/pull/1000
Full Changelog: https://github.com/cakephp/migrations/compare/4.9.3...4.9.4
Fix phinx backend using incorrect RollbackCommand class by @dereuromark in https://github.com/cakephp/migrations/pull/991
Full Changelog: https://github.com/cakephp/migrations/compare/4.9.2...4.9.3
Fix error running migrations with type timestamptimezone by @markstory in https://github.com/cakephp/migrations/pull/979
timestamptimezone by @markstory in https://github.com/cakephp/migrations/pull/979Full Changelog: https://github.com/cakephp/migrations/compare/4.9.1...4.9.2
Remove null collate option from generated migrations by @dereuromark in https://github.com/cakephp/migrations/pull/975
Full Changelog: https://github.com/cakephp/migrations/compare/4.9.0...4.9.1
Fix up default for sqlserver by @dereuromark in https://github.com/cakephp/migrations/pull/930
Full Changelog: https://github.com/cakephp/migrations/compare/4.8.2...4.9.0
Fix up schema to only be configured if set by @dereuromark in https://github.com/cakephp/migrations/pull/912
Full Changelog: https://github.com/cakephp/migrations/compare/4.8.1...4.8.2
Fix up blob columns. by @dereuromark in https://github.com/cakephp/migrations/pull/913
Full Changelog: https://github.com/cakephp/migrations/compare/4.8.0...4.8.1
Add deprecation for getDecoratedConnection() by @markstory in https://github.com/cakephp/migrations/pull/908
Full Changelog: https://github.com/cakephp/migrations/compare/4.7.2...4.8.0
Fix Literal default values by @markstory in https://github.com/cakephp/migrations/pull/891
Full Changelog: https://github.com/cakephp/migrations/compare/4.7.1...4.7.2
Clean up code-sniffing violations in baked migrations by @josbeir in https://github.com/cakephp/migrations/pull/876
Full Changelog: https://github.com/cakephp/migrations/compare/4.7.0...4.7.1
The double type is now aliased to float(52) storage. This format change reflects both double being deprecated in MySQL, and cakephp using float.
This release further integrates cakephp/database into the builtin backend. The next step is going to be a major release where the builtin backend is made the primary and only backend that migrations supports.
The builtin migrations backend now uses cakephp/database for schema reflection and generation. Previously, migrations used phinx, which differ from those in cakephp/database. If you are using column types that do not exist in cakephp/database, you may need to adjust your migrations. See below for changes in each SQL dialect.
set, and enum types are no longer supported.double type is now aliased to float(52) storage. This format change reflects both double being deprecated in MySQL, and cakephp using float.BLOB_REGULAR length is deprecated.integer types.binary with length values to indicate whether they are tiny, regular, medium or long.Full Changelog: https://github.com/cakephp/migrations/compare/4.6.6...4.7.0
Prevent usage of new count option yet, as there is no built-in way yet and it would be dangerous to accidently run "all"
count option yet, as there is no built-in way yet and it would be dangerous to accidently run "all"Full Changelog: https://github.com/cakephp/migrations/compare/4.6.5...4.6.6
Fix up deprecation warning. by @dereuromark in https://github.com/cakephp/migrations/pull/865
Full Changelog: https://github.com/cakephp/migrations/compare/4.6.4...4.6.5
Call getArrayOption instead of deprecated getMultipleOption method… by @Noahbrat in https://github.com/cakephp/migrations/pull/842
Full Changelog: https://github.com/cakephp/migrations/compare/4.6.3...4.6.4
fix bug with IDENTITY_INSERT by @LordSimal in https://github.com/cakephp/migrations/pull/826
IDENTITY_INSERT by @LordSimal in https://github.com/cakephp/migrations/pull/826Arguments::getArrayOption by @cleptric in https://github.com/cakephp/migrations/pull/830Arguments::getArrayOption" by @dereuromark in https://github.com/cakephp/migrations/pull/832Full Changelog: https://github.com/cakephp/migrations/compare/4.6.2...4.6.3
Update more deprecated method usage by @markstory in https://github.com/cakephp/migrations/pull/824
Full Changelog: https://github.com/cakephp/migrations/compare/4.6.1...4.6.2
Fix deprecations from setConstraint() by @markstory in https://github.com/cakephp/migrations/pull/817
Full Changelog: https://github.com/cakephp/migrations/compare/4.6.0...4.6.1
Fix typos. by @dereuromark in https://github.com/cakephp/migrations/pull/775
Full Changelog: https://github.com/cakephp/migrations/compare/4.5.0...4.6.0
Fix typos. by @dereuromark in https://github.com/cakephp/migrations/pull/775
Full Changelog: https://github.com/cakephp/migrations/compare/4.5.0...4.5.1
This release introduces new base classes for migrations - Migrations\BaseMigration, and seeds Migrations\BaseSeed. These new base classes will be used
This release introduces new base classes for migrations - Migrations\BaseMigration, and seeds Migrations\BaseSeed. These new base classes will be used in newly generated migrations, snapshots and diffs if the builtin backend is enabled. These base classes are not compatible with phinx, and represent the forwards compatible path for applications.
In a future cakephp/upgrade release a rector rule will be added to change existing migrations to the new base classes.
Full Changelog: https://github.com/cakephp/migrations/compare/4.4.2...4.5.0
Fix for MySQL 8 DEFAULT_GENERATED extra by @nojimage in https://github.com/cakephp/migrations/pull/755
Full Changelog: https://github.com/cakephp/migrations/compare/4.4.1...4.4.2
Correcting getGlobalSchemaName to use the correct schema by @challgren in https://github.com/cakephp/migrations/pull/728
Full Changelog: https://github.com/cakephp/migrations/compare/4.4.0...4.4.1
Following the addition of the builtin backend in 4.3.0, the builtin backend is now the default in 4.4.0. If your migrations don't run correctly with 4
Following the addition of the builtin backend in 4.3.0, the builtin backend is now the default in 4.4.0. If your migrations don't run correctly with 4.4.0 please open an issue. You can temporarily switch back to the phinx backend by setting Migrations.backend = 'phinx' in your config/app.php.
The phinx backend is planned for removal in the 5.0 release which will follow 4.4 after collecting feedback from the community for a few months.
Full Changelog: https://github.com/cakephp/migrations/compare/4.3.2...4.4.0
Add datetime column support to addTimestamps() by @markstory in https://github.com/cakephp/migrations/pull/721
Full Changelog: https://github.com/cakephp/migrations/compare/4.3.1...4.3.2
Handle database with escapable identifiers in name by @jharder in https://github.com/cakephp/migrations/pull/717
Full Changelog: https://github.com/cakephp/migrations/compare/4.3.0...4.3.1
As of migrations 4.3. there is a new migrations backend that uses CakePHP's database abstractions and ORM. Longer term this will allow for phinx to be
As of migrations 4.3. there is a new migrations backend that uses CakePHP's database abstractions and ORM. Longer term this will allow for phinx to be removed as a dependency. Reducing the dependencies of migrations helps keep your applications dependencies smaller. Migrations can also benefit from improvements in the ORM with less lag time as they no longer need to be re-implemented in phinx. Lastly, it streamlines the number of APIs you have to learn. Migrations included APIs that are very different from CakePHPs, and we can now align querying and data manipulation APIs so that you don't have to remember two different APIs depending on the context.
Your migrations shouldn't have to change much to adapt to the new backend. The migrations backend implements all of the phinx interfaces and can run migrations based on phinx classes. If your migrations fail for a reason not outlined below please open an issue.
If your migrations are using the AdapterInterface to fetch rows or update rows you will need to update your code. If you use Adapter::query() to execute queries, the return of this method is now Cake\Database\StatementInterface instead. This impacts fetchAll(), and fetch().
The new backend can be enabled through application configuration. Add the following to your config/app.php::
return [
// Other configuration.
'Migrations' => ['backend' => 'builtin'],
];
If your migrations have problems running with the builtin backend, removing this configuration option will revert to using phinx.
migrations create alias with new backend by @markstory in https://github.com/cakephp/migrations/pull/704migrations --help command by @markstory in https://github.com/cakephp/migrations/pull/710Full Changelog: https://github.com/cakephp/migrations/compare/4.2.0...4.3.0
Fixed initial snapshot does not define collation info by @rrd108 in https://github.com/cakephp/migrations/pull/653
Full Changelog: https://github.com/cakephp/migrations/compare/4.1.0...4.2.0
## Changes - Support latest Phinx 0.15.3
This release fixes dependencies after the invalid Phinx 2.0 release was rolled back and Phinx 0.15 released instead.
This release fixes dependencies after the invalid Phinx 2.0 release was rolled back and Phinx 0.15 released instead.
Along with Phinx support, this fixes and improves index generation that was hidden behind disabled tests. You can find more information on that here: https://github.com/cakephp/migrations/pull/628.
Full Changelog: https://github.com/cakephp/migrations/compare/4.0.2...4.1.0
Bump actions/checkout from 3 to 4 by @dependabot in https://github.com/cakephp/migrations/pull/632
Full Changelog: https://github.com/cakephp/migrations/compare/4.0.1...4.0.2
Update dependencies to stable versions.
Full Changelog: https://github.com/cakephp/migrations/compare/4.0.0...4.0.1
4.x - Fix workflow deprecations. by @ndm2 in https://github.com/cakephp/migrations/pull/627
addTimestamps() to set created and modified column names as default by @LordSimal in https://github.com/cakephp/migrations/pull/619Full Changelog: https://github.com/cakephp/migrations/compare/3.8.2...4.0.0
bake migration_diff now supports --source for multiple database configs by @telepathPiddlingAccent in https://github.com/cakephp/migrations/pull/618
Full Changelog: https://github.com/cakephp/migrations/compare/3.8.3...3.9.0
## What's Changed * #633 Quote schema for PostgreSQL in the CakeAdapter by @pabloelcolombiano in https://github.com/cakephp/migrations/pull/635 Full C
Full Changelog: https://github.com/cakephp/migrations/compare/3.8.2...3.8.3
Use index names in migration snapshots by @thonhaus in https://github.com/cakephp/migrations/pull/617
Full Changelog: https://github.com/cakephp/migrations/compare/3.8.1...3.8.2
Fix error strpos if $lastfile is null by @WideeFr in https://github.com/cakephp/migrations/pull/611
Full Changelog: https://github.com/cakephp/migrations/compare/3.8.0...3.8.1
Add error message when using runMany() and skip by @markstory in https://github.com/cakephp/migrations/pull/604
class name to follow the migration command by @MarwanSalim in https://github.com/cakephp/migrations/pull/609Full Changelog: https://github.com/cakephp/migrations/compare/3.7.2...3.8.0
Set BC feature flags to false for now. by @dereuromark in https://github.com/cakephp/migrations/pull/600 This restores BC with <=3.6. If you want to k
// config/app.php
'Migrations' => [
'unsigned_primary_keys' => true,
'column_null_default' => true,
],
Full Changelog: https://github.com/cakephp/migrations/compare/3.7.1...3.7.2
Fixed regression on Seed folder generation, partially reverts #584 by @challgren in https://github.com/cakephp/migrations/pull/597
Full Changelog: https://github.com/cakephp/migrations/compare/3.7.0...3.7.1
Fixed up Migrations for Phinx 0.13 integration. The migration bake templates needed adjustement in regards to param/return types
BC impact: Since Phinx 0.13 foreign key columns are expected to be specified with "signed" => false. Make sure to update your table columns here if you are using any constraints here with 0.13+.
You can also use 3.7.2+ which keeps BC with previous behavior.
Note: Make sure you updated your migration files in your project to contain all return types for methods before applying this update.
Seed classes:
- public function run()
+ public function run(): void
Migration classes:
- public function change()
+ public function change(): void
Same for up()/down() if in use.
Full Changelog: https://github.com/cakephp/migrations/compare/3.6.1...3.7.0
Add support for DSN options. by @ndm2 in https://github.com/cakephp/migrations/pull/582
Full Changelog: https://github.com/cakephp/migrations/compare/3.6.0...3.6.1
Mode / Cache Parameter Support by @swiffer in https://github.com/cakephp/migrations/pull/574
Mode / Cache Parameter Support by @swiffer in https://github.com/cakephp/migrations/pull/574
Users can now set the cache=shared option when using a sqlite connection to run tests migrations in-memory.
Full Changelog: https://github.com/cakephp/migrations/compare/3.5.3...3.6.0
bake a valid drop migration by @LordSimal in https://github.com/cakephp/migrations/pull/554
bake migrations command by @markstory in https://github.com/cakephp/migrations/pull/563Full Changelog: https://github.com/cakephp/migrations/compare/3.5.2...3.5.3
One column per quarter.