4.3.0
版本发布时间: 2024-05-03 11:24:50
cakephp/migrations最新发布版本:4.4.1(2024-09-16 23:17:15)
New Backend
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.
What is the same?
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.
What is different?
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()
.
Enabling the new backend
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.
Summary of pull requests
- Get started on PhinxAdapter by @markstory in https://github.com/cakephp/migrations/pull/679
- Get Environment tests passing with migrations engine by @markstory in https://github.com/cakephp/migrations/pull/682
- Get manager tests passing with new backend by @markstory in https://github.com/cakephp/migrations/pull/684
- Import Config and wire it into Manager and Environment by @markstory in https://github.com/cakephp/migrations/pull/685
- Add config switch for backend selection. by @markstory in https://github.com/cakephp/migrations/pull/686
- Start implementing commands using builtin backend by @markstory in https://github.com/cakephp/migrations/pull/688
- Trim down Config and Manager classes to remove unused behavior by @markstory in https://github.com/cakephp/migrations/pull/689
- Update to use cake connections pt1 by @markstory in https://github.com/cakephp/migrations/pull/690
- Update Adapter classes to use Connection pt1 by @markstory in https://github.com/cakephp/migrations/pull/694
- Remove Symfony/Console from Manager and Adapter by @markstory in https://github.com/cakephp/migrations/pull/695
- Add new Migrate command by @markstory in https://github.com/cakephp/migrations/pull/697
- Add Dump command for new backend by @markstory in https://github.com/cakephp/migrations/pull/698
- Add schema lock file generation to migrate command by @markstory in https://github.com/cakephp/migrations/pull/699
- Add Mark migrated command by @markstory in https://github.com/cakephp/migrations/pull/700
- Add rollback command by @markstory in https://github.com/cakephp/migrations/pull/701
- Expand test coverage for migration events. by @markstory in https://github.com/cakephp/migrations/pull/702
- Add seed command by @markstory in https://github.com/cakephp/migrations/pull/703
- Add
migrations create
alias with new backend by @markstory in https://github.com/cakephp/migrations/pull/704 - Add docs on the intended upgrade process. by @markstory in https://github.com/cakephp/migrations/pull/705
- Migrations builtin backend by @markstory in https://github.com/cakephp/migrations/pull/706
- Convert FeatureFlags to Configure operations by @markstory in https://github.com/cakephp/migrations/pull/707
- Add test covering mark_migrated and plugins by @markstory in https://github.com/cakephp/migrations/pull/709
- Add
migrations --help
command by @markstory in https://github.com/cakephp/migrations/pull/710 - Align postgres build config with no-phinx by @markstory in https://github.com/cakephp/migrations/pull/712
- 696 - Fix table method to add the table to array as phinx does by @ajibarra in https://github.com/cakephp/migrations/pull/711
- Cleanup by @markstory in https://github.com/cakephp/migrations/pull/713
- Merge in 'builtin' backend to 4.x by @markstory in https://github.com/cakephp/migrations/pull/714
Full Changelog: https://github.com/cakephp/migrations/compare/4.2.0...4.3.0