cakephp / phinx

PHP Database Migrations for Everyone
https://phinx.org
MIT License
4.45k stars 895 forks source link

Fix using string primary_key value for sqlite #2285

Closed MasterOdin closed 2 months ago

MasterOdin commented 2 months ago

Fixes #2283

PR fixes a bug for sqlite where if a string value was passed for the primary_key option, then following error would be thrown:

ArgumentCountError: Too few arguments to function Phinx\Db\Adapter\SQLiteAdapter::hasPrimaryKey(), 1 passed in /home/mpeveler/github/phinx/tests/Phinx/Db/Adapter/SQLiteAdapterTest.php on line 179 and at least 2 expected

Surprisingly, this looks like it's been broken for 4+ years, though I guess not too many people use sqlite and use custom identity columns for primary keys.