forked from wallabag/wallabag
Use a better index for hashed_url
It'll most often be used in addition to the `user_id`. Also, automatically generate the hash when saving the url. Switch from `md5` to `sha1`.
This commit is contained in:
@ -72,11 +72,8 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
|
||||
$entry1->setUrl($url);
|
||||
|
||||
$em->persist($entry1);
|
||||
|
||||
$em->flush();
|
||||
|
||||
$this->assertNull($entry1->getHashedUrl());
|
||||
|
||||
$application = new Application($this->getClient()->getKernel());
|
||||
$application->add(new GenerateUrlHashesCommand());
|
||||
|
||||
@ -92,7 +89,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
|
||||
|
||||
$entry = $em->getRepository('WallabagCoreBundle:Entry')->findOneByUrl($url);
|
||||
|
||||
$this->assertSame($entry->getHashedUrl(), hash('md5', $url));
|
||||
$this->assertSame($entry->getHashedUrl(), hash('sha1', $url));
|
||||
|
||||
$query = $em->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\Entry e WHERE e.url = :url');
|
||||
$query->setParameter('url', $url);
|
||||
|
||||
Reference in New Issue
Block a user