mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-04 10:32:40 +00:00
Adding isset() checks for CakeSchema::compare() when diff'ing db indexes.
Allows for slightly better interoperability between schemas generated with CakePHP 1.2 and with 1.3
This commit is contained in:
parent
026eeb645b
commit
730153b151
1 changed files with 7 additions and 3 deletions
|
@ -428,11 +428,15 @@ class CakeSchema extends Object {
|
|||
if (isset($old[$table]['indexes']) && isset($new[$table]['indexes'])) {
|
||||
$diff = $this->_compareIndexes($new[$table]['indexes'], $old[$table]['indexes']);
|
||||
if ($diff) {
|
||||
if (isset($tables[$table]['drop']['indexes']) && isset($diff['drop'])) {
|
||||
$tables[$table]['drop']['indexes'] = $diff['drop'];
|
||||
}
|
||||
if (isset($tables[$table]['add']['indexes']) && isset($diff['add'])) {
|
||||
$tables[$table]['add']['indexes'] = $diff['add'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $tables;
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue