Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

This is a Database Migrations system for CakePHP.

The plugin consists of a CakePHP CLI wrapper for the [Phinx](https://book.cakephp.org/phinx/0/en/index.html) migrations library.
The plugin provides a complete database migration solution with support for creating, running, and managing migrations.

This branch is for use with CakePHP **5.x**. See [version map](https://github.com/cakephp/migrations/wiki#version-map) for details.

Expand All @@ -33,21 +33,6 @@ If you are using the PendingMigrations middleware, use:
bin/cake plugin load Migrations
```

### Enabling the builtin backend

In a future release, migrations will be switching to a new backend based on the CakePHP ORM. We're aiming
to be compatible with as many existing migrations as possible, and could use your feedback. Enable the
new backend with:

```php
// in app/config/app_local.php
$config = [
// Other configuration
'Migrations' => ['backend' => 'builtin'],
];

```

## Documentation

Full documentation of the plugin can be found on the [CakePHP Cookbook](https://book.cakephp.org/migrations/4/).
Full documentation of the plugin can be found on the [CakePHP Cookbook](https://book.cakephp.org/migrations/5/).
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cakephp/migrations",
"description": "Database Migration plugin for CakePHP based on Phinx",
"description": "Database Migration plugin for CakePHP",
"license": "MIT",
"type": "cakephp-plugin",
"keywords": [
Expand All @@ -25,7 +25,8 @@
"php": ">=8.1",
"cakephp/cache": "^5.2",
"cakephp/orm": "^5.2",
"robmorgan/phinx": "^0.16.10"
"symfony/config": "^6.0 || ^7.0",
"symfony/console": "^6.0 || ^7.0"
Comment on lines +28 to +29
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to remove these dependencies as well when some more code is removed.

},
"require-dev": {
"cakephp/bake": "^3.3",
Expand Down
1 change: 0 additions & 1 deletion config/app.example.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

return [
'Migrations' => [
'backend' => 'builtin',
'unsigned_primary_keys' => null,
'column_null_default' => null,
],
Expand Down
2 changes: 1 addition & 1 deletion docs/en/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ pass them to the method::
Feature Flags
=============

Migrations offers a few feature flags to compatibility with phinx. These features are disabled by default but can be enabled if required:
Migrations offers a few feature flags for compatibility. These features are disabled by default but can be enabled if required:

* ``unsigned_primary_keys``: Should Migrations create primary keys as unsigned integers? (default: ``false``)
* ``column_null_default``: Should Migrations create columns as null by default? (default: ``false``)
Expand Down
29 changes: 10 additions & 19 deletions docs/en/upgrading-to-builtin-backend.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ Upgrading to the builtin backend

As of migrations 4.3 there is a new migrations backend that uses CakePHP's
database abstractions and ORM. In 4.4, the ``builtin`` backend became the
default backend. Longer term this will allow for phinx to be
removed as a dependency. This greatly reduces the dependency footprint of
migrations.
default backend. As of migrations 5.0, phinx has been removed as a dependency
and only the builtin backend is supported. This greatly reduces the dependency
footprint of migrations.

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 don't work in a way that
could be addressed by the changes outlined below, please open an issue, as we'd
like to maintain as much compatibility as we can.
The builtin backend provides similar functionality to what was available with
phinx. If your migrations don't work in a way that could be addressed by the
changes outlined below, please open an issue.

What is different?
==================
Expand Down Expand Up @@ -43,16 +42,8 @@ Similar changes are for fetching a single row::
$stmt = $this->getAdapter()->query('SELECT * FROM articles');
$rows = $stmt->fetch('assoc');

Problems with the new backend?
==============================
Problems with the builtin backend?
==================================

The new backend is enabled by default. If your migrations contain errors when
run with the builtin backend, please open `an issue
<https://github.com/cakephp/migrations/issues/new>`_. You can also switch back
to the ``phinx`` backend through application configuration. Add the
following to your ``config/app.php``::

return [
// Other configuration.
'Migrations' => ['backend' => 'phinx'],
];
If your migrations contain errors when run with the builtin backend, please
open `an issue <https://github.com/cakephp/migrations/issues/new>`_.
2 changes: 1 addition & 1 deletion docs/en/writing-migrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Bake will automatically creates a skeleton migration file with a single method:
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* https://book.cakephp.org/migrations/4/en/migrations.html#the-change-method
* https://book.cakephp.org/migrations/5/en/migrations.html#the-change-method
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
Expand Down
9 changes: 0 additions & 9 deletions docs/fr/conf.py

This file was deleted.

5 changes: 0 additions & 5 deletions docs/fr/contents.rst

This file was deleted.

Loading
Loading