1
0
mirror of synced 2025-02-09 00:39:25 +03:00

#1294 - fixing differences between 2.5 and 2.4 fixes (reverts DBAL dependency bump)

This commit is contained in:
Marco Pivetta 2015-02-04 23:46:15 +00:00
parent 2e9ffe831c
commit db06355b63

View File

@ -449,12 +449,10 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory
$sequenceName = null; $sequenceName = null;
$fieldName = $class->identifier ? $class->getSingleIdentifierFieldName() : null; $fieldName = $class->identifier ? $class->getSingleIdentifierFieldName() : null;
// Platforms that do not have native IDENTITY support need a sequence to emulate this behaviour. if ($this->getTargetPlatform() instanceof Platforms\PostgreSQLPlatform) {
if ($this->getTargetPlatform()->usesSequenceEmulatedIdentityColumns()) {
$columnName = $class->getSingleIdentifierColumnName(); $columnName = $class->getSingleIdentifierColumnName();
$quoted = isset($class->fieldMappings[$fieldName]['quoted']) || isset($class->table['quoted']); $quoted = isset($class->fieldMappings[$fieldName]['quoted']) || isset($class->table['quoted']);
$sequencePrefix = $class->getSequencePrefix($this->getTargetPlatform()); $sequenceName = $class->getTableName() . '_' . $columnName . '_seq';
$sequenceName = $this->getTargetPlatform()->getIdentitySequenceName($sequencePrefix, $columnName);
$definition = array( $definition = array(
'sequenceName' => $this->getTargetPlatform()->fixSchemaElementName($sequenceName) 'sequenceName' => $this->getTargetPlatform()->fixSchemaElementName($sequenceName)
); );
@ -484,10 +482,10 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory
if ( ! $definition) { if ( ! $definition) {
$fieldName = $class->getSingleIdentifierFieldName(); $fieldName = $class->getSingleIdentifierFieldName();
$sequenceName = $class->getSequenceName($this->getTargetPlatform()); $columnName = $class->getSingleIdentifierColumnName();
$quoted = isset($class->fieldMappings[$fieldName]['quoted']) || isset($class->table['quoted']); $quoted = isset($class->fieldMappings[$fieldName]['quoted']) || isset($class->table['quoted']);
$sequenceName = $class->getTableName() . '_' . $columnName . '_seq';
$definition = array( $definition = array(
'sequenceName' => $this->getTargetPlatform()->fixSchemaElementName($sequenceName), 'sequenceName' => $this->getTargetPlatform()->fixSchemaElementName($sequenceName),
'allocationSize' => 1, 'allocationSize' => 1,
'initialValue' => 1, 'initialValue' => 1,