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
Branches
No related tags found
No related merge requests found
...@@ -186,7 +186,7 @@ class MDB2SchemaReader { ...@@ -186,7 +186,7 @@ class MDB2SchemaReader {
} }
} }
if (isset($name) && isset($type)) { if (isset($name) && isset($type)) {
if (empty($options['default'])) { if (isset($options['default']) && empty($options['default'])) {
if (empty($options['notnull']) || !$options['notnull']) { if (empty($options['notnull']) || !$options['notnull']) {
unset($options['default']); unset($options['default']);
$options['notnull'] = false; $options['notnull'] = false;
......
...@@ -57,13 +57,13 @@ class MDB2SchemaReader extends \PHPUnit_Framework_TestCase { ...@@ -57,13 +57,13 @@ class MDB2SchemaReader extends \PHPUnit_Framework_TestCase {
$this->assertNull($table->getColumn('clobfield')->getLength()); $this->assertNull($table->getColumn('clobfield')->getLength());
$this->assertFalse($table->getColumn('clobfield')->getAutoincrement()); $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->assertTrue($table->getColumn('clobfield')->getNotnull());
$this->assertInstanceOf('Doctrine\DBAL\Types\TextType', $table->getColumn('clobfield')->getType()); $this->assertInstanceOf('Doctrine\DBAL\Types\TextType', $table->getColumn('clobfield')->getType());
$this->assertNull($table->getColumn('booleanfield')->getLength()); $this->assertNull($table->getColumn('booleanfield')->getLength());
$this->assertFalse($table->getColumn('booleanfield')->getAutoincrement()); $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->assertInstanceOf('Doctrine\DBAL\Types\BooleanType', $table->getColumn('booleanfield')->getType());
$this->assertTrue($table->getColumn('booleanfield_true')->getDefault()); $this->assertTrue($table->getColumn('booleanfield_true')->getDefault());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment