Merge pull request #5813 from owncloud/fix-4736-master
Don't set a default value when there isn't a default specified
This commit is contained in:
commit
49e9f771ff
|
@ -186,7 +186,7 @@ class MDB2SchemaReader {
|
|||
}
|
||||
}
|
||||
if (isset($name) && isset($type)) {
|
||||
if (empty($options['default'])) {
|
||||
if (isset($options['default']) && empty($options['default'])) {
|
||||
if (empty($options['notnull']) || !$options['notnull']) {
|
||||
unset($options['default']);
|
||||
$options['notnull'] = false;
|
||||
|
|
|
@ -57,13 +57,13 @@ class MDB2SchemaReader extends \PHPUnit_Framework_TestCase {
|
|||
|
||||
$this->assertNull($table->getColumn('clobfield')->getLength());
|
||||
$this->assertFalse($table->getColumn('clobfield')->getAutoincrement());
|
||||
$this->assertSame('', $table->getColumn('clobfield')->getDefault());
|
||||
$this->assertNull($table->getColumn('clobfield')->getDefault());
|
||||
$this->assertTrue($table->getColumn('clobfield')->getNotnull());
|
||||
$this->assertInstanceOf('Doctrine\DBAL\Types\TextType', $table->getColumn('clobfield')->getType());
|
||||
|
||||
$this->assertNull($table->getColumn('booleanfield')->getLength());
|
||||
$this->assertFalse($table->getColumn('booleanfield')->getAutoincrement());
|
||||
$this->assertFalse($table->getColumn('booleanfield')->getDefault());
|
||||
$this->assertNull($table->getColumn('booleanfield')->getDefault());
|
||||
$this->assertInstanceOf('Doctrine\DBAL\Types\BooleanType', $table->getColumn('booleanfield')->getType());
|
||||
|
||||
$this->assertTrue($table->getColumn('booleanfield_true')->getDefault());
|
||||
|
|
Loading…
Reference in New Issue