Skip to content
Permalink
Browse files

Adding placeholder method to DboMysql to handle alteration of table p…

…arameter statement generation.
  • Loading branch information...
markstory committed Oct 3, 2009
1 parent 2fe877e commit 0b6d6cee6ca60771738cedabc34e89bab24a8ff3
Showing with 18 additions and 1 deletion.
  1. +18 −1 cake/libs/model/datasources/dbo/dbo_mysql.php
@@ -248,14 +248,18 @@ function alterSchema($compare, $table = null) {
$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) {
if (isset($column['indexes'])) {
$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 @@ function alterSchema($compare, $table = null) {
}
}
$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 @@ function dropSchema($schema, $table = null) {
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.
*

0 comments on commit 0b6d6ce

Please sign in to comment.
You can’t perform that action at this time.