diff --git a/src/SimpleThings/EntityAudit/EventListener/CreateSchemaListener.php b/src/SimpleThings/EntityAudit/EventListener/CreateSchemaListener.php index 9a6747d2..c6cabc6b 100644 --- a/src/SimpleThings/EntityAudit/EventListener/CreateSchemaListener.php +++ b/src/SimpleThings/EntityAudit/EventListener/CreateSchemaListener.php @@ -97,6 +97,8 @@ public function postGenerateSchemaTable(GenerateSchemaTableEventArgs $eventArgs) $pkColumns = $entityTable->getPrimaryKey()->getColumns(); $pkColumns[] = $this->config->getRevisionFieldName(); $revisionTable->setPrimaryKey($pkColumns); + $revIndexName = $this->config->getRevisionFieldName().'_'.md5($revisionTable->getName()).'_idx'; + $revisionTable->addIndex(array($this->config->getRevisionFieldName()),$revIndexName); } public function postGenerateSchema(GenerateSchemaEventArgs $eventArgs)