From 1367fc234fce4f2e79c02e3780b5727faa5992e4 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 22 Jan 2015 00:06:25 +0100 Subject: [PATCH] [ticket/13282] Use 0 as default for integer type columns in postgresql PHPBB3-13282 --- phpBB/phpbb/db/tools.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php index f523b39fb3..ee0d247071 100644 --- a/phpBB/phpbb/db/tools.php +++ b/phpBB/phpbb/db/tools.php @@ -1574,7 +1574,15 @@ class tools } else { - $default_val = "'" . $column_data[1] . "'"; + // 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] . "'"; + } $return_array['null'] = 'NULL'; $sql .= 'NULL '; }