[ticket/13282] Use 0 as default for integer type columns in postgresql

PHPBB3-13282
This commit is contained in:
Marc Alexander 2015-01-22 00:06:25 +01:00
parent a737eeb6ce
commit 1367fc234f

View file

@ -1573,8 +1573,16 @@ class tools
$sql .= 'NOT NULL '; $sql .= 'NOT NULL ';
} }
else else
{
// Integers need to have 0 instead of empty string as default
if (preg_match('/int/i', $column_type))
{
$default_val = '0';
}
else
{ {
$default_val = "'" . $column_data[1] . "'"; $default_val = "'" . $column_data[1] . "'";
}
$return_array['null'] = 'NULL'; $return_array['null'] = 'NULL';
$sql .= 'NULL '; $sql .= 'NULL ';
} }