Adding placeholder method to DboMysql to handle alteration of table parameter statement generation.

This commit is contained in:
mark_story 2009-10-03 16:49:01 -04:00
parent 2fe877e527
commit 0b6d6cee6c

View file

@ -248,7 +248,7 @@ class DboMysqlBase extends DboSource {
$out = '';
$colList = array();
foreach ($compare as $curTable => $types) {
$indexes = array();
$indexes = $tableParameters = array();
if (!$table || $table == $curTable) {
$out .= 'ALTER TABLE ' . $this->fullTableName($curTable) . " \n";
foreach ($types as $type => $column) {
@ -256,6 +256,10 @@ class DboMysqlBase extends DboSource {
$indexes[$type] = $column['indexes'];
unset($column['indexes']);
}
if (isset($column['tableParameters'])) {
$tableParameters[$type] = $column['tableParameters'];
unset($column['tableParameters']);
}
switch ($type) {
case 'add':
foreach ($column as $field => $col) {
@ -284,6 +288,7 @@ class DboMysqlBase extends DboSource {
}
}
$colList = array_merge($colList, $this->_alterIndexes($curTable, $indexes));
$colList = array_merge($colList, $this->_alterTableParameters($curTable, $tableParameters));
$out .= "\t" . join(",\n\t", $colList) . ";\n\n";
}
}
@ -312,6 +317,18 @@ class DboMysqlBase extends DboSource {
return $out;
}
/**
* Generate MySQL table parameter alteration statementes for a table.
*
* @param string $table Table to alter parameters for.
* @param array $parameters Parameters to add & drop.
* @return array Array of table property alteration statementes.
* @todo Implement this method.
**/
function _alterTableParameters($table, $parameters) {
return array();
}
/**
* Generate MySQL index alteration statements for a table.
*