Tweaks to the MDB2SchemaReader

This commit is contained in:
Bart Visscher 2013-07-18 20:28:57 +02:00
parent 5549c77ec5
commit e2b6781cf9
3 changed files with 8 additions and 3 deletions

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

View File

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

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