Commit 7a993d2e authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge branch 'DBAL-511' into 2.3

parents ac0c0630 7284d6f3
......@@ -258,6 +258,10 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
$autoincrement = true;
}
if (preg_match("/^'(.*)'::.*$/", $tableColumn['default'], $matches)) {
$tableColumn['default'] = $matches[1];
}
if (stripos($tableColumn['default'], 'NULL') === 0) {
$tableColumn['default'] = null;
}
......
......@@ -244,6 +244,23 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
}
}
}
/**
* @group DBAL-511
*/
public function testDefaultValueCharacterVarying()
{
$testTable = new \Doctrine\DBAL\Schema\Table('dbal511_default');
$testTable->addColumn('id', 'integer');
$testTable->addColumn('def', 'string', array('default' => 'foo'));
$testTable->setPrimaryKey(array('id'));
$this->_sm->createTable($testTable);
$databaseTable = $this->_sm->listTableDetails($testTable->getName());
print_r($databaseTable);
}
}
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