summaryrefslogtreecommitdiffstats
path: root/lib/db
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-03-17 15:25:41 +0100
committerBart Visscher <bartv@thisnet.nl>2013-03-17 15:25:41 +0100
commit2866376f344b83d3aa6f1692b571a359c880909d (patch)
treec15764bef8e4bdd8ad90888057ef8ad5d352d2b3 /lib/db
parentee57ddd0b78d83afeeded76057177e990fff9fa4 (diff)
downloadnextcloud-server-2866376f344b83d3aa6f1692b571a359c880909d.tar.gz
nextcloud-server-2866376f344b83d3aa6f1692b571a359c880909d.zip
Fix handling of empty defaults in schema
Diffstat (limited to 'lib/db')
-rw-r--r--lib/db/mdb2schemareader.php14
1 files changed, 5 insertions, 9 deletions
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']);
}
}