Commit 8be725c4 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge branch 'DDC-2843' into 2.4

parents 2ae916ad 77742599
...@@ -343,6 +343,14 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager ...@@ -343,6 +343,14 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
break; break;
case 'bool': case 'bool':
case 'boolean': case 'boolean':
if ($tableColumn['default'] === 'true') {
$tableColumn['default'] = true;
}
if ($tableColumn['default'] === 'false') {
$tableColumn['default'] = false;
}
$length = null; $length = null;
break; break;
case 'text': case 'text':
......
...@@ -261,6 +261,25 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -261,6 +261,25 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
$this->assertEquals('foo', $databaseTable->getColumn('def')->getDefault()); $this->assertEquals('foo', $databaseTable->getColumn('def')->getDefault());
} }
/**
* @group DDC-2843
*/
public function testBooleanDefault()
{
$table = new \Doctrine\DBAL\Schema\Table('ddc2843_bools');
$table->addColumn('id', 'integer');
$table->addColumn('checked', 'boolean', array('default' => false));
$this->_sm->createTable($table);
$databaseTable = $this->_sm->listTableDetails($table->getName());
$c = new \Doctrine\DBAL\Schema\Comparator();
$diff = $c->diffTable($table, $databaseTable);
$this->assertFalse($diff);
}
} }
class MoneyType extends Type class MoneyType extends Type
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment