Skip to content

Commit

Permalink
Adding method to compare tableParameters in the Schema, so they no lo…
Browse files Browse the repository at this point in the history
…nger fall through as fields.
  • Loading branch information
markstory committed Oct 3, 2009
1 parent 0fc6f58 commit 2fe877e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
17 changes: 16 additions & 1 deletion cake/libs/model/cake_schema.php
Expand Up @@ -496,7 +496,11 @@ function compare($old, $new = null) {
}
}
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;
Expand Down Expand Up @@ -567,6 +571,17 @@ function __columns(&$Obj) {
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
*
Expand Down
1 change: 0 additions & 1 deletion cake/tests/cases/libs/model/cake_schema.test.php
Expand Up @@ -546,7 +546,6 @@ function testSchemaComparison() {
),
'drop' => array(
'article_id' => array('type' => 'integer', 'null' => false),
'tableParameters' => array()
),
'change' => array(
'comment' => array('type' => 'text', 'null' => false, 'default' => null)
Expand Down

0 comments on commit 2fe877e

Please sign in to comment.