Skip to content
Snippets Groups Projects
Commit 49e9f771 authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #5813 from owncloud/fix-4736-master

Don't set a default value when there isn't a default specified
parents 6ef39931 9c1c8d57
No related branches found
No related tags found
No related merge requests found
......@@ -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());
......
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