packagist robmorgan/phinx 0.15.0

latest releases: 0.x-dev, dev-dependabot/github_actions/codecov/codecov-action-4, dev-dereuromark-patch-1...
12 months ago

Breaking Changes

PHP 8.1 / Type declarations

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 #2218 for all the files affected.

Foreign Key Handling

In previous versions, Phinx was inconsistent with how it handled foreign keys across the adapters. Per #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

1) In a case sensitive database the query would produce an error.
2) Generates duplicate drop instructions, one for every key that has any of the given columns.
3) For every column, the first key that starts with that column would be deleted.

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

1) The behavior is independent of whether the database/column is actually case-sensitive.

Features

Docs

New Contributors

Full Changelog: 0.14.0...0.15.0

Don't miss a new phinx release

NewReleases is sending notifications on new releases.