MyGit

4.3.0

cakephp/migrations

版本发布时间: 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

Full Changelog: https://github.com/cakephp/migrations/compare/4.2.0...4.3.0

相关地址:原始地址 下载(tar) 下载(zip)

查看:2024-05-03发行的版本