Use hash given url to avoid duplicate

Using hashed url we can ensure an index on them to ensure it's fast.
This commit is contained in:
Jeremy Benoist
2019-05-29 14:18:04 +02:00
parent b7fa51ae7d
commit f3bfb875e9
6 changed files with 134 additions and 132 deletions

View File

@ -368,7 +368,7 @@ class EntryRepository extends EntityRepository
{
$res = $this->createQueryBuilder('e')
->where('e.hashedUrl = :hashed_url')->setParameter('hashed_url', $hashedUrl)
// ->orWhere('e.givenUrl = :url')->setParameter('url', $url)
->orWhere('e.hashedGivenUrl = :hashed_given_url')->setParameter('hashed_given_url', $hashedUrl)
->andWhere('e.user = :user_id')->setParameter('user_id', $userId)
->getQuery()
->getResult();