Skip to content

Commit

Permalink
Now we unset default for text fields, not just blob and clob
Browse files Browse the repository at this point in the history
# This solves the problem in MDB2_Schema that many people are having in regards to dumping database to a schema file and installing it again
# Empty default results in a varchar field instead of plain text


git-svn-id: http://svn.php.net/repository/pear/packages/MDB2/trunk@243119 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information
helgi committed Sep 29, 2007
1 parent 23acd52 commit 43278a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions MDB2/Driver/Reverse/mysql.php
Expand Up @@ -143,7 +143,7 @@ function getTableFieldDefinition($table_name, $field_name)
}
foreach ($types as $key => $type) {
$definition[$key] = $definition[0];
if ($type == 'clob' || $type == 'blob') {
if ($type == 'clob' || $type == 'blob' || $type == 'text') {
unset($definition[$key]['default']);
}
$definition[$key]['type'] = $type;
Expand Down Expand Up @@ -337,7 +337,7 @@ function getTableConstraintDefinition($table_name, $constraint_name)
return $definition;
}
}

return $db->raiseError(MDB2_ERROR_NOT_FOUND, null, null,
$constraint_name . ' is not an existing table constraint', __FUNCTION__);
}
Expand Down
6 changes: 3 additions & 3 deletions MDB2/Driver/Reverse/mysqli.php
Expand Up @@ -197,7 +197,7 @@ function getTableFieldDefinition($table_name, $field_name)
}
foreach ($types as $key => $type) {
$definition[$key] = $definition[0];
if ($type == 'clob' || $type == 'blob') {
if ($type == 'clob' || $type == 'blob' || $type == 'text') {
unset($definition[$key]['default']);
}
$definition[$key]['type'] = $type;
Expand Down Expand Up @@ -228,7 +228,7 @@ function getTableIndexDefinition($table_name, $index_name)
if (PEAR::isError($db)) {
return $db;
}

list($schema, $table) = $this->splitTableSchema($table_name);

$table = $db->quoteIdentifier($table, true);
Expand Down Expand Up @@ -303,7 +303,7 @@ function getTableConstraintDefinition($table_name, $constraint_name)
if (PEAR::isError($db)) {
return $db;
}

list($schema, $table) = $this->splitTableSchema($table_name);
$constraint_name_original = $constraint_name;

Expand Down

0 comments on commit 43278a3

Please sign in to comment.