Ability to replace primaryKey field via config (6.x)#707
Ability to replace primaryKey field via config (6.x)#707asgraf wants to merge 1 commit intoFriendsOfCake:6.xfrom
Conversation
Example:
$this->Crud->action()->setConfig('primaryKey', 'uuid');
|
Wouldn't it make more sense to change this in the table itself? Or why would one change this for the CRUD component but not in the table (thus for the whole application)? A primary key normally doesn't get changed... 🤷 |
Yes, normally it does not (see dereuromark/cakephp-expose for details)
With For url like SELECT [fields list] FROM articles as Articles WHERE Articles.id = 'SAftQtJqYjAs3XRMsWgRfk'This would fail because SELECT [fields list] FROM articles as Articles WHERE Articles.uuid = 'efbfbdef-bfbd-7d56-efbf-bdefbfbd41ef'
Changing primary key at table level would break all queries with |
|
Seems like a test is needed to prove the functionality |
|
@asgraf Are you still adding the test? Then this could get merged. |
Example use case:
this change makes
FriendsOfCake/crudplugin compatible withdereuromark/cakephp-expose