phinx icon indicating copy to clipboard operation
phinx copied to clipboard

SqlServerAdapter::getColumns returns associative array

Open MasterOdin opened this issue 3 months ago • 2 comments

The SqlServerAdapter::getColumns function returns an associative array of columns, where the keys are column names. All other adapters return a numeric array which is also expressed by our AdapterInterface:

https://github.com/cakephp/phinx/blob/8270c6ec96bb1262c43c5f1ea322b6b4218cac28/src/Phinx/Db/Adapter/AdapterInterface.php#L426-L432

The SqlServerAdapter::getColumns method should be changed to return numeric array. As this is public facing functionality, this will require a major release.

MasterOdin avatar Nov 04 '25 17:11 MasterOdin

Thats a valid point. I took a stab at this in https://github.com/cakephp/migrations/pull/953

Maybe the next phinx release can do sth similar.

dereuromark avatar Nov 10 '25 09:11 dereuromark

Prepared PR -> https://github.com/cakephp/phinx/pull/2402

lutdev avatar Dec 10 '25 22:12 lutdev