From 00eb0d3b67f19c98f5949bfceac713f0a454ff02 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Wed, 27 Aug 2014 13:56:02 +0200 Subject: [PATCH 1/2] Fixed the structure of the reverse-engineered mapping --- lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php b/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php index ce35e7e9f..e51c15282 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php @@ -407,7 +407,7 @@ class DatabaseDriver implements MappingDriver case Type::STRING: case Type::TEXT: $fieldMapping['length'] = $column->getLength(); - $fieldMapping['fixed'] = $column->getFixed(); + $fieldMapping['options']['fixed'] = $column->getFixed(); break; case Type::DECIMAL: @@ -419,18 +419,18 @@ class DatabaseDriver implements MappingDriver case Type::INTEGER: case Type::BIGINT: case Type::SMALLINT: - $fieldMapping['unsigned'] = $column->getUnsigned(); + $fieldMapping['options']['unsigned'] = $column->getUnsigned(); break; } // Comment if (($comment = $column->getComment()) !== null) { - $fieldMapping['comment'] = $comment; + $fieldMapping['options']['comment'] = $comment; } // Default if (($default = $column->getDefault()) !== null) { - $fieldMapping['default'] = $default; + $fieldMapping['options']['default'] = $default; } return $fieldMapping; From f0c02bb6d96efdd40211c30d1fabbdf12d7c8ffc Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Wed, 27 Aug 2014 14:00:34 +0200 Subject: [PATCH 2/2] Fixed the test expectations for the DatabaseDriver --- tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php b/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php index 17285ac20..64295f3cf 100644 --- a/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php @@ -189,14 +189,14 @@ class DatabaseDriverTest extends DatabaseDriverTestCase if ( ! $this->_em->getConnection()->getDatabasePlatform() instanceof PostgreSqlPlatform AND ! $this->_em->getConnection()->getDatabasePlatform() instanceof SQLServerPlatform) { $this->assertArrayHasKey('columnUnsigned', $metadata->fieldMappings); - $this->assertTrue($metadata->fieldMappings['columnUnsigned']['unsigned']); + $this->assertTrue($metadata->fieldMappings['columnUnsigned']['options']['unsigned']); } $this->assertArrayHasKey('columnComment', $metadata->fieldMappings); - $this->assertEquals('test_comment', $metadata->fieldMappings['columnComment']['comment']); + $this->assertEquals('test_comment', $metadata->fieldMappings['columnComment']['options']['comment']); $this->assertArrayHasKey('columnDefault', $metadata->fieldMappings); - $this->assertEquals('test_default', $metadata->fieldMappings['columnDefault']['default']); + $this->assertEquals('test_default', $metadata->fieldMappings['columnDefault']['options']['default']); $this->assertArrayHasKey('columnDecimal', $metadata->fieldMappings); $this->assertEquals(4, $metadata->fieldMappings['columnDecimal']['precision']);