mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-06-13 18:23:36 +00:00
Fix issue where createSchema() would omit primary keys sometimes.
Fix missing primary key SQL when using the primary flag + other indexes. Fixes #3292
This commit is contained in:
parent
1c0c8604c8
commit
a0a61b5980
2 changed files with 47 additions and 1 deletions
lib/Cake/Model/Datasource
|
@ -2984,7 +2984,7 @@ class DboSource extends DataSource {
|
|||
$tableParameters = array_merge($tableParameters, $this->buildTableParameters($col, $table));
|
||||
}
|
||||
}
|
||||
if (empty($indexes) && !empty($primary)) {
|
||||
if (!isset($columns['indexes']['PRIMARY']) && !empty($primary)) {
|
||||
$col = array('PRIMARY' => array('column' => $primary, 'unique' => 1));
|
||||
$indexes = array_merge($indexes, $this->buildIndex($col, $table));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue