cakephp / phinx

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

primary_key string value with SqliteAdapter results in TypeError #2283

Closed InvisibleSmiley closed 2 months ago

InvisibleSmiley commented 2 months ago
$this->table('foo', ['id' => false, 'primary_key' => 'foo_id'])
->addColumn('foo_id', 'integer', ['identity' => true])
->create();

(this is just an example, I know I could use id here or drop it altogether)

With SQLiteAdapter:

TypeError: array_search(): Argument #2 ($haystack) must be of type array, string given
.../vendor/robmorgan/phinx/src/Phinx/Db/Adapter/SQLiteAdapter.php:433

No issues with MysqlAdapter.

MasterOdin commented 2 months ago

Thanks for reporting the bug. This will be fixed in the next release of phinx.