mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Adding method to compare tableParameters in the Schema, so they no longer fall through as fields.
This commit is contained in:
parent
0fc6f58cfb
commit
2fe877e527
2 changed files with 16 additions and 2 deletions
|
@ -496,7 +496,11 @@ class CakeSchema extends Object {
|
|||
}
|
||||
}
|
||||
if (isset($old[$table]['tableParameters']) && isset($new[$table]['tableParameters'])) {
|
||||
|
||||
$diff = $this->_compareTableParameters($new[$table]['tableParameters'], $old[$table]['tableParameters']);
|
||||
if ($diff) {
|
||||
$tables[$table]['drop']['tableParameters'] = $diff['drop'];
|
||||
$tables[$table]['add']['tableParameters'] = $diff['add'];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $tables;
|
||||
|
@ -567,6 +571,17 @@ class CakeSchema extends Object {
|
|||
return $columns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare two schema files table Parameters
|
||||
*
|
||||
* @param array $new New indexes
|
||||
* @param array $old Old indexes
|
||||
* @return mixed False on failure, or an array of parameters to add & drop.
|
||||
**/
|
||||
function _compareTableParameters($new, $old) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare two schema indexes
|
||||
*
|
||||
|
|
|
@ -546,7 +546,6 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
),
|
||||
'drop' => array(
|
||||
'article_id' => array('type' => 'integer', 'null' => false),
|
||||
'tableParameters' => array()
|
||||
),
|
||||
'change' => array(
|
||||
'comment' => array('type' => 'text', 'null' => false, 'default' => null)
|
||||
|
|
Loading…
Add table
Reference in a new issue