summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-07-18 20:28:57 +0200
committerBart Visscher <bartv@thisnet.nl>2013-07-18 21:07:56 +0200
commite2b6781cf9a97e4ad10e4824e38ccdaf3c2dc676 (patch)
tree144d0ac510206f4b6ad973078f8a1f8965a639dc /lib
parent5549c77ec5256722fc11e92745c8fe769bece285 (diff)
downloadnextcloud-server-e2b6781cf9a97e4ad10e4824e38ccdaf3c2dc676.tar.gz
nextcloud-server-e2b6781cf9a97e4ad10e4824e38ccdaf3c2dc676.zip
Tweaks to the MDB2SchemaReader
Diffstat (limited to 'lib')
-rw-r--r--lib/db/mdb2schemareader.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/db/mdb2schemareader.php b/lib/db/mdb2schemareader.php
index 4dc1fd4616d..0ead9528c93 100644
--- a/lib/db/mdb2schemareader.php
+++ b/lib/db/mdb2schemareader.php
@@ -148,6 +148,8 @@ class OC_DB_MDB2SchemaReader {
if (empty($options['notnull']) || !$options['notnull']) {
unset($options['default']);
$options['notnull'] = false;
+ } else {
+ $options['default'] = '';
}
if ($type == 'integer') {
$options['default'] = 0;
@@ -165,9 +167,12 @@ class OC_DB_MDB2SchemaReader {
$type = 'bigint';
}
}
- $table->addColumn($name, $type, $options);
if (!empty($options['autoincrement'])
&& !empty($options['notnull'])) {
+ $options['primary'] = true;
+ }
+ $table->addColumn($name, $type, $options);
+ if (!empty($options['primary']) && $options['primary']) {
$table->setPrimaryKey(array($name));
}
}