Skip to content
Snippets Groups Projects
Commit e2b6781c authored by Bart Visscher's avatar Bart Visscher
Browse files

Tweaks to the MDB2SchemaReader

parent 5549c77e
No related branches found
No related tags found
No related merge requests found
Subproject commit c8623cc80d47022cb25874b69849cd2f57fd4874 Subproject commit 25e8568d41a9b9a6d1662ccf33058822a890e7f5
...@@ -383,7 +383,7 @@ ...@@ -383,7 +383,7 @@
<name>user</name> <name>user</name>
<type>text</type> <type>text</type>
<default></default> <default></default>
<notnull>false</notnull> <notnull>true</notnull>
<length>64</length> <length>64</length>
</field> </field>
......
...@@ -148,6 +148,8 @@ class OC_DB_MDB2SchemaReader { ...@@ -148,6 +148,8 @@ class OC_DB_MDB2SchemaReader {
if (empty($options['notnull']) || !$options['notnull']) { if (empty($options['notnull']) || !$options['notnull']) {
unset($options['default']); unset($options['default']);
$options['notnull'] = false; $options['notnull'] = false;
} else {
$options['default'] = '';
} }
if ($type == 'integer') { if ($type == 'integer') {
$options['default'] = 0; $options['default'] = 0;
...@@ -165,9 +167,12 @@ class OC_DB_MDB2SchemaReader { ...@@ -165,9 +167,12 @@ class OC_DB_MDB2SchemaReader {
$type = 'bigint'; $type = 'bigint';
} }
} }
$table->addColumn($name, $type, $options);
if (!empty($options['autoincrement']) if (!empty($options['autoincrement'])
&& !empty($options['notnull'])) { && !empty($options['notnull'])) {
$options['primary'] = true;
}
$table->addColumn($name, $type, $options);
if (!empty($options['primary']) && $options['primary']) {
$table->setPrimaryKey(array($name)); $table->setPrimaryKey(array($name));
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment