Allowed to import visits to existing already imported short URLs

This commit is contained in:
Alejandro Celaya
2021-04-18 11:58:59 +02:00
parent 9a78d1585d
commit c8b8947b1f
4 changed files with 76 additions and 44 deletions

View File

@@ -203,6 +203,9 @@ class VisitRepository extends EntitySpecificationRepository implements VisitRepo
private function resolveVisitsWithNativeQuery(QueryBuilder $qb, ?int $limit, ?int $offset): array
{
// TODO Order by date and ID, not just by ID (order by date DESC, id DESC).
// That ensures imported visits are properly ordered even if inserted in wrong chronological order.
$qb->select('v.id')
->orderBy('v.id', 'DESC')
// Falling back to values that will behave as no limit/offset, but will workaround MS SQL not allowing