Adding method to compare tableParameters in the Schema, so they no longer fall through as fields.

This commit is contained in:
mark_story 2009-10-03 16:48:10 -04:00
parent 0fc6f58cfb
commit 2fe877e527
2 changed files with 16 additions and 2 deletions

View file

@ -496,7 +496,11 @@ class CakeSchema extends Object {
} }
} }
if (isset($old[$table]['tableParameters']) && isset($new[$table]['tableParameters'])) { 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; return $tables;
@ -567,6 +571,17 @@ class CakeSchema extends Object {
return $columns; 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 * Compare two schema indexes
* *

View file

@ -546,7 +546,6 @@ class CakeSchemaTest extends CakeTestCase {
), ),
'drop' => array( 'drop' => array(
'article_id' => array('type' => 'integer', 'null' => false), 'article_id' => array('type' => 'integer', 'null' => false),
'tableParameters' => array()
), ),
'change' => array( 'change' => array(
'comment' => array('type' => 'text', 'null' => false, 'default' => null) 'comment' => array('type' => 'text', 'null' => false, 'default' => null)