Skip to content

Releases: cakephp/phinx

0.15.2

22 Sep 18:39
26753bd
Compare
Choose a tag to compare

Fixes

  • Allow Table::addColumn() to use type from Column object again by @othercorey in #2224

Full Changelog: 0.15.1...0.15.2

0.15.1

21 Sep 21:32
acda135
Compare
Choose a tag to compare

Fixes

  • Ensure PostgresAdapter::useIdentity is always initialized by @othercorey in #2223

Full Changelog: 0.15.0...0.15.1

0.15.0

19 Sep 09:27
a1c4ec5
Compare
Choose a tag to compare

Note: The 2.0.0, 2.0.1, and 2.0.2 tags were created incorrectly, and have been deleted and will be removed from packagist. This release features all of the same features and changes that was in those releases. We are still using 0.x releases as the API is not yet considered stable, as evidenced by the breaking change below.

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.

For users that overwrite $autoId in their migration class, this will now need a bool type declaration:

public bool $autoId = false;

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

0.14.0

10 Sep 14:13
7bc24ba
Compare
Choose a tag to compare

Breaking Changes

Fixes

Docs

New Contributors

Full Changelog: 0.13.4...0.14.0

0.13.4

07 Jan 01:21
18e06e4
Compare
Choose a tag to compare

Feature Flags

This release adds feature flags, which allows for toggling behavior of Phinx to better fit your workflow. Currently, there are two flags that opt out of breaking changes that were added in 0.13.0, namely allowing to restore behavior of having primary keys signed by default as well as making columns not null by default.

Fixes

  • Fix custom column types not working anymore by @ndm2 in #2156
  • Restored migration template method return types by @Bilge in #2160
  • Fix foreign key constraint violations on implicit table drops by @ndm2 in #2131
  • Add feature flags to disable some 0.13.0 breaking changes by @MasterOdin in #2159
  • Changed breakpoint column to disallow nulls again by @Bilge in #2162

Full Changelog: 0.13.3...0.13.4

0.13.3

08 Dec 20:03
da741d1
Compare
Choose a tag to compare

Fixes

  • Fix string to int return type by @dereuromark in #2150
  • Fix rolling back columns with indices for SQLite and SQL Server by @ndm2 in #2128
  • Add testcases for Util::getVersionFromFileName function by @MasterOdin in #2153
  • Fix reference to MysqlAdapter::FIRST constant in migrations doc by @niekatywny in #2143

Full Changelog: 0.13.2...0.13.3

0.13.2

30 Nov 02:16
f18dd21
Compare
Choose a tag to compare

Fixes

New Contributors

Full Changelog: 0.13.1...0.13.2

0.13.1

11 Oct 04:51
eccde74
Compare
Choose a tag to compare

Fixes

  • Fix target being set to 0 if omitted when running migrate by @nrob81 in #2115
  • Fix deprecation warning on return value for Config::offsetGet by @MasterOdin in #2117

Full Changelog: 0.13.0...0.13.1

0.13.0

06 Oct 11:45
Compare
Choose a tag to compare

Breaking Changes

  • set column null by default unless identity by @MasterOdin in #1872. Previously columns were created as NOT NULL by default, and to now get that behavior, you will need to explicitly pass 'null' => false in the column options.
  • remove remove $direction argument to preFlightCheck and postFlightCheck (use isMigratingUp property) by @MasterOdin in #1892
  • make utf8mb4 default charset and collation for new mysql tables by @MasterOdin in #1875 (Set charset and collation setting in phinx.php to utf8mb3 for prior behavior)
  • make default PKs for mysql unsigned by default by @MasterOdin in #1899. When defining foreign keys, you will need to now need to set $signed => false. To restore prior behavior, pass $signed => true when defining the default PK.
  • Add type hints to codebase by @MasterOdin in #1995 (This does not affect the up, down, or change methods for AbstractMigration. If you extend from phinx, you will need to add type hinting to your code)
  • remove deprecated hasSchemaTable function from AdapterInterface by @MasterOdin in #1877
  • remove deprecated insert, dropTable methods from MigrationInterface by @MasterOdin in #1878
  • Do not set code when recasting PDOException when connecting to DB by @MasterOdin in #2101
  • Implement identity in PostgresAdapter by @ajibarra in #2085 (identity columns for postgres 10+ will now be generated as INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY instead of SERIAL NOT NULL)

Deprecations

  • Deprecate the default_migration_table config setting, use migration_table instead by @MasterOdin in #1961

New Features

  • add createSchema and dropSchema methods on MigrationInterface by @MasterOdin in #1871

Improvements

  • remove check on column type for setting collation / encoding by @MasterOdin in #1881
  • trigger deprecation notice when using default_database by @MasterOdin in #1890 (function had been marked as deprecated in 0.12.0)
  • add support for smallserial alias for postgres by @MasterOdin in #1915 (note, using smallinteger on an identity column will now use the type smallserial)
  • allow setting migration_table per environment by @MasterOdin in #1961
  • Add new shouldExecute method to AbstractMigration and AbstractSeed by @AdrienPoupa in #1939
  • Add for geometry column type to SqlServerAdapter by @tedce in #1969
  • Add optional $params argument to query/execute adapter methods to allow usage of prepared queries by @MasterOdin in #1962
  • Allow specifying template style for create command by @MasterOdin in #2013 (note, the name of the base migration file has changed, argument has changed for AbstractCommand::getMigrationTemplateFilename)
  • Improve associative array phpdocs by @dereuromark in #2034
  • Pass environment to seed from manager by @martenb in #2102 (note, parameter change to Manager::getSeeds method)

Full Changelog: 0.12.13...0.13.0

0.12.13

03 Oct 05:00
6eb0f29
Compare
Choose a tag to compare

Fixes

  • Fix defaultName deprecation warning on symfony/console 6.1 by @MasterOdin in #2107

Full Changelog: 0.12.12...0.12.13