mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
adding default name, for dbs that dont expose a PK
This commit is contained in:
parent
b5c4b85601
commit
0a1772c929
1 changed files with 1 additions and 0 deletions
|
@ -298,6 +298,7 @@ class ModelTask extends BakeTask {
|
||||||
* @return string Name of field that is a primary key.
|
* @return string Name of field that is a primary key.
|
||||||
*/
|
*/
|
||||||
public function findPrimaryKey($fields) {
|
public function findPrimaryKey($fields) {
|
||||||
|
$name = 'id';
|
||||||
foreach ($fields as $name => $field) {
|
foreach ($fields as $name => $field) {
|
||||||
if (isset($field['key']) && $field['key'] == 'primary') {
|
if (isset($field['key']) && $field['key'] == 'primary') {
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue