diff options
author | Oliver Gasser <oliver.gasser@gmail.com> | 2013-11-10 14:14:27 +0100 |
---|---|---|
committer | Oliver Gasser <oliver.gasser@gmail.com> | 2013-11-10 14:15:33 +0100 |
commit | b278356eb92e50cd2d0016e78319d50d943bca41 (patch) | |
tree | 437546cc0f7e3eb37d2d5f15e3bcb5d409e6d350 | |
parent | 841c62208551425361f311969260e95eded9101a (diff) | |
download | nextcloud-server-b278356eb92e50cd2d0016e78319d50d943bca41.tar.gz nextcloud-server-b278356eb92e50cd2d0016e78319d50d943bca41.zip |
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````:
````
<field>
<name>modified</name>
<type>decimal</type>
<default/>
<notnull>true</notnull>
<length>15</length>
</field>
````
See owncloud/mozilla_sync#14
-rw-r--r-- | lib/private/db/mdb2schemareader.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/db/mdb2schemareader.php b/lib/private/db/mdb2schemareader.php index b7128a2f176..9890becd9a3 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; |