Merge pull request #1123 from stof/patch-1
Fixed the structure of the reverse-engineered mapping
This commit is contained in:
commit
6e79515a75
@ -407,7 +407,7 @@ class DatabaseDriver implements MappingDriver
|
|||||||
case Type::STRING:
|
case Type::STRING:
|
||||||
case Type::TEXT:
|
case Type::TEXT:
|
||||||
$fieldMapping['length'] = $column->getLength();
|
$fieldMapping['length'] = $column->getLength();
|
||||||
$fieldMapping['fixed'] = $column->getFixed();
|
$fieldMapping['options']['fixed'] = $column->getFixed();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Type::DECIMAL:
|
case Type::DECIMAL:
|
||||||
@ -419,18 +419,18 @@ class DatabaseDriver implements MappingDriver
|
|||||||
case Type::INTEGER:
|
case Type::INTEGER:
|
||||||
case Type::BIGINT:
|
case Type::BIGINT:
|
||||||
case Type::SMALLINT:
|
case Type::SMALLINT:
|
||||||
$fieldMapping['unsigned'] = $column->getUnsigned();
|
$fieldMapping['options']['unsigned'] = $column->getUnsigned();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Comment
|
// Comment
|
||||||
if (($comment = $column->getComment()) !== null) {
|
if (($comment = $column->getComment()) !== null) {
|
||||||
$fieldMapping['comment'] = $comment;
|
$fieldMapping['options']['comment'] = $comment;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
if (($default = $column->getDefault()) !== null) {
|
if (($default = $column->getDefault()) !== null) {
|
||||||
$fieldMapping['default'] = $default;
|
$fieldMapping['options']['default'] = $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $fieldMapping;
|
return $fieldMapping;
|
||||||
|
@ -189,14 +189,14 @@ class DatabaseDriverTest extends DatabaseDriverTestCase
|
|||||||
if ( ! $this->_em->getConnection()->getDatabasePlatform() instanceof PostgreSqlPlatform AND
|
if ( ! $this->_em->getConnection()->getDatabasePlatform() instanceof PostgreSqlPlatform AND
|
||||||
! $this->_em->getConnection()->getDatabasePlatform() instanceof SQLServerPlatform) {
|
! $this->_em->getConnection()->getDatabasePlatform() instanceof SQLServerPlatform) {
|
||||||
$this->assertArrayHasKey('columnUnsigned', $metadata->fieldMappings);
|
$this->assertArrayHasKey('columnUnsigned', $metadata->fieldMappings);
|
||||||
$this->assertTrue($metadata->fieldMappings['columnUnsigned']['unsigned']);
|
$this->assertTrue($metadata->fieldMappings['columnUnsigned']['options']['unsigned']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->assertArrayHasKey('columnComment', $metadata->fieldMappings);
|
$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->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->assertArrayHasKey('columnDecimal', $metadata->fieldMappings);
|
||||||
$this->assertEquals(4, $metadata->fieldMappings['columnDecimal']['precision']);
|
$this->assertEquals(4, $metadata->fieldMappings['columnDecimal']['precision']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user