]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Entry.php
Use a better index for hashed_url
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Entry.php
index a04f101f4165c7cf8d9d449795ee0ed1ad0ee018..faf4d259801e32a20f9b222f0a509fb6db4d194a 100644 (file)
@@ -26,7 +26,7 @@ use Wallabag\UserBundle\Entity\User;
  *     indexes={
  *         @ORM\Index(name="created_at", columns={"created_at"}),
  *         @ORM\Index(name="uid", columns={"uid"}),
- *         @ORM\Index(name="hashed_url", columns={"hashed_url"})
+ *         @ORM\Index(name="hashed_url_user_id", columns={"user_id", "hashed_url"})
  *     }
  * )
  * @ORM\HasLifecycleCallbacks()
@@ -79,7 +79,7 @@ class Entry
     /**
      * @var string
      *
-     * @ORM\Column(name="hashed_url", type="string", length=32, nullable=true)
+     * @ORM\Column(name="hashed_url", type="string", length=40, nullable=true)
      */
     private $hashedUrl;
 
@@ -324,6 +324,7 @@ class Entry
     public function setUrl($url)
     {
         $this->url = $url;
+        $this->hashedUrl = hash('sha1', $url);
 
         return $this;
     }