From: Bart Visscher Date: Sun, 17 Mar 2013 14:25:41 +0000 (+0100) Subject: Fix handling of empty defaults in schema X-Git-Tag: v6.0.0alpha2~444^2~35 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2866376f344b83d3aa6f1692b571a359c880909d;p=nextcloud-server.git Fix handling of empty defaults in schema --- diff --git a/lib/db/mdb2schemareader.php b/lib/db/mdb2schemareader.php index 6408c27e916..1d71af1700c 100644 --- a/lib/db/mdb2schemareader.php +++ b/lib/db/mdb2schemareader.php @@ -124,17 +124,13 @@ class OC_DB_MDB2SchemaReader { } if (isset($name) && isset($type)) { if (empty($options['default'])) { + if (empty($options['notnull']) || !$options['notnull']) { + unset($options['default']); + } if ($type == 'integer') { - if (empty($options['default'])) { - if (empty($options['notnull'])) { - unset($options['default']); - } - else { - $options['default'] = 0; - } - } + $options['default'] = 0; } - if (!empty($options['autoincrement'])) { + if (!empty($options['autoincrement']) && $options['autoincrement']) { unset($options['default']); } }