#1294 - fixing differences between 2.5 and 2.4 fixes (reverts DBAL dependency bump)
This commit is contained in:
parent
2e9ffe831c
commit
db06355b63
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user