Skip to content

Commit

Permalink
MDL-29567 postgresql - handle negative defaults in numerical cols pro…
Browse files Browse the repository at this point in the history
…perly
  • Loading branch information
stronk7 committed Sep 28, 2011
1 parent c75d9b6 commit 69857fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/dml/pgsql_native_moodle_database.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ public function get_columns($table, $usecache=true) {
$info->scale = null;
$info->not_null = ($rawcolumn->attnotnull === 't');
if ($info->has_default) {
$info->default_value = $rawcolumn->adsrc;
$info->default_value = trim($rawcolumn->adsrc, '()');
} else {
$info->default_value = null;
}
Expand All @@ -433,7 +433,7 @@ public function get_columns($table, $usecache=true) {
$info->not_null = ($rawcolumn->attnotnull === 't');
$info->has_default = ($rawcolumn->atthasdef === 't');
if ($info->has_default) {
$info->default_value = $rawcolumn->adsrc;
$info->default_value = trim($rawcolumn->adsrc, '()');
} else {
$info->default_value = null;
}
Expand All @@ -451,7 +451,7 @@ public function get_columns($table, $usecache=true) {
$info->not_null = ($rawcolumn->attnotnull === 't');
$info->has_default = ($rawcolumn->atthasdef === 't');
if ($info->has_default) {
$info->default_value = $rawcolumn->adsrc;
$info->default_value = trim($rawcolumn->adsrc, '()');
} else {
$info->default_value = null;
}
Expand Down

0 comments on commit 69857fa

Please sign in to comment.