mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +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
|
@ -168,7 +168,7 @@ class CakeSchema extends Object {
|
|||
* Reads database and creates schema tables
|
||||
*
|
||||
* Options
|
||||
*
|
||||
*
|
||||
* - 'connection' - the db connection to use
|
||||
* - 'name' - name of the schema
|
||||
* - 'models' - a list of models to use, or false to ignore models
|
||||
|
@ -428,8 +428,12 @@ class CakeSchema extends Object {
|
|||
if (isset($old[$table]['indexes']) && isset($new[$table]['indexes'])) {
|
||||
$diff = $this->_compareIndexes($new[$table]['indexes'], $old[$table]['indexes']);
|
||||
if ($diff) {
|
||||
$tables[$table]['drop']['indexes'] = $diff['drop'];
|
||||
$tables[$table]['add']['indexes'] = $diff['add'];
|
||||
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'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue