diff --git a/src/ORM/Translatable/TranslatableSubscriber.php b/src/ORM/Translatable/TranslatableSubscriber.php index e0e5a8b4..0e9615c0 100644 --- a/src/ORM/Translatable/TranslatableSubscriber.php +++ b/src/ORM/Translatable/TranslatableSubscriber.php @@ -227,12 +227,9 @@ private function mapTranslation(ClassMetadata $classMetadata) $name = $classMetadata->getTableName().'_unique_translation'; if (!$this->hasUniqueTranslationConstraint($classMetadata, $name)) { - $classMetadata->setPrimaryTable([ - 'uniqueConstraints' => [[ - 'name' => $name, - 'columns' => ['translatable_id', 'locale' ] - ]], - ]); + $classMetadata->table['uniqueConstraints'][$name] = [ + 'columns' => ['translatable_id', 'locale' ] + ]; } if (!$classMetadata->hasField('locale')) {