Tweaks to the MDB2SchemaReader

remotes/origin/stable6
Bart Visscher 12 years ago
parent 5549c77ec5
commit e2b6781cf9
  1. 2
      3rdparty
  2. 2
      db_structure.xml
  3. 7
      lib/db/mdb2schemareader.php

@ -1 +1 @@
Subproject commit c8623cc80d47022cb25874b69849cd2f57fd4874
Subproject commit 25e8568d41a9b9a6d1662ccf33058822a890e7f5

@ -383,7 +383,7 @@
<name>user</name>
<type>text</type>
<default></default>
<notnull>false</notnull>
<notnull>true</notnull>
<length>64</length>
</field>

@ -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));
}
}

Loading…
Cancel
Save