From b278356eb92e50cd2d0016e78319d50d943bca41 Mon Sep 17 00:00:00 2001 From: Oliver Gasser Date: Sun, 10 Nov 2013 14:14:27 +0100 Subject: [PATCH] DB: Set correct default value for numeric types Set 0 as default value for columns with numeric data type instead of the empty string ''. Otherwise the database complains about an invalid default value for this column. To reproduce put the following in your ````appinfo/database.xml````: ```` modified decimal true 15 ```` See owncloud/mozilla_sync#14 --- lib/private/db/mdb2schemareader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/db/mdb2schemareader.php b/lib/private/db/mdb2schemareader.php index b7128a2f17..9890becd9a 100644 --- a/lib/private/db/mdb2schemareader.php +++ b/lib/private/db/mdb2schemareader.php @@ -193,7 +193,7 @@ class MDB2SchemaReader { } else { $options['default'] = ''; } - if ($type == 'integer') { + if ($type == 'integer' || $type == 'numeric') { $options['default'] = 0; } elseif ($type == 'boolean') { $options['default'] = false;