]> source.dussan.org Git - nextcloud-server.git/commitdiff
Tweaks to the MDB2SchemaReader
authorBart Visscher <bartv@thisnet.nl>
Thu, 18 Jul 2013 18:28:57 +0000 (20:28 +0200)
committerBart Visscher <bartv@thisnet.nl>
Thu, 18 Jul 2013 19:07:56 +0000 (21:07 +0200)
3rdparty
db_structure.xml
lib/db/mdb2schemareader.php

index c8623cc80d47022cb25874b69849cd2f57fd4874..25e8568d41a9b9a6d1662ccf33058822a890e7f5 160000 (submodule)
--- a/3rdparty
+++ b/3rdparty
@@ -1 +1 @@
-Subproject commit c8623cc80d47022cb25874b69849cd2f57fd4874
+Subproject commit 25e8568d41a9b9a6d1662ccf33058822a890e7f5
index 4c192ba028e54a70ad6048f1d014d0e0bbcb4166..ef5de653033c573f69077830e5ce6a51dfb46a3f 100644 (file)
                                <name>user</name>
                                <type>text</type>
                                <default></default>
-                               <notnull>false</notnull>
+                               <notnull>true</notnull>
                                <length>64</length>
                        </field>
 
index 4dc1fd4616d63df7d89fa579dd14de371c3b6a47..0ead9528c937d5b41d85b2103a7eb5182dbcf80a 100644 (file)
@@ -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));
                        }
                }