Add small time differences to the datafixtures log entries, to get a defined order

This commit is contained in:
Jan Böhmer 2024-06-23 18:03:54 +02:00
parent a54ce939ca
commit 88ef1788ac
2 changed files with 8 additions and 1 deletions

View file

@ -225,7 +225,10 @@ class LogEntryRepository extends DBElementRepository
->leftJoin('log.user', 'user')
->andWhere('log.target_type = :target_type')
->andWhere('log.target_id = :target_id')
->orderBy('log.timestamp', 'DESC');
->orderBy('log.timestamp', 'DESC')
//Use id as fallback, if timestamp is the same (higher id means newer entry)
->addOrderBy('log.id', 'DESC')
;
$qb->setParameter('target_type', LogTargetType::fromElementClass($element));
$qb->setParameter('target_id', $element->getID());