aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2015-01-23 17:32:28 +0100
committerJoas Schilling <nickvergessen@gmx.de>2015-01-23 17:32:28 +0100
commit9cdbb69f9e50f665caad54fc93f64143cb7d8fc8 (patch)
tree93116ade2e8c37dc11d1fefa6a59510cf4f18359 /phpBB/phpbb/db
parent40ab75478ed7427985e4d147eb6573ce8bb351fc (diff)
parenteb4594d8ee6a662f6e268a8d802c8a7110cd55c7 (diff)
downloadforums-9cdbb69f9e50f665caad54fc93f64143cb7d8fc8.tar
forums-9cdbb69f9e50f665caad54fc93f64143cb7d8fc8.tar.gz
forums-9cdbb69f9e50f665caad54fc93f64143cb7d8fc8.tar.bz2
forums-9cdbb69f9e50f665caad54fc93f64143cb7d8fc8.tar.xz
forums-9cdbb69f9e50f665caad54fc93f64143cb7d8fc8.zip
Merge pull request #3321 from marc1706/ticket/13282
[ticket/13282] Use 0 as default for integer type columns in postgresql
Diffstat (limited to 'phpBB/phpbb/db')
-rw-r--r--phpBB/phpbb/db/tools.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php
index f523b39fb3..775deccc30 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 (strpos($column_type, 'INT') === 0)
+ {
+ $default_val = '0';
+ }
+ else
+ {
+ $default_val = "'" . $column_data[1] . "'";
+ }
$return_array['null'] = 'NULL';
$sql .= 'NULL ';
}