]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Fixed index on entry.uuid and changed uuid field type
authorNicolas Lœuillet <nicolas@loeuillet.org>
Sun, 18 Dec 2016 13:09:56 +0000 (14:09 +0100)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Sun, 25 Dec 2016 09:51:25 +0000 (10:51 +0100)
.travis.yml
src/Wallabag/CoreBundle/Controller/EntryController.php
src/Wallabag/CoreBundle/Entity/Entry.php
tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php

index 8c8093bf4ed88967ab847856a84506a6c0f00107..7468b1162bf444533a2bac0324ba213a4c07c4e9 100644 (file)
@@ -5,13 +5,14 @@ services:
   - redis
 
 # faster builds on docker-container setup
-sudo: false
+sudo: required
 
 # used for HHVM
 addons:
   apt:
     packages:
       - tidy
+  postgresql: 9.5
 
 # cache vendor dirs
 cache:
@@ -59,6 +60,7 @@ before_script:
     - if [[ ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
     - composer self-update --no-progress
     - if [[ $DB = pgsql ]]; then psql -c 'create database wallabag_test;' -U postgres; fi;
+    - if [[ $DB = pgsql ]]; then psql -U postgres wallabag_test -c 'create extension "uuid-ossp";'; fi;
 
 install:
     - if [[ $ASSETS = build ]]; then source ~/.nvm/nvm.sh && nvm install 6.7; fi;
index b03f49eda339efe7af80441d9a46b0710e99a056..831486714a25b50b04f12e319711a7c5bd8495e1 100644 (file)
@@ -355,6 +355,9 @@ class EntryController extends Controller
     {
         $this->checkUserAction($entry);
 
+        $version = $this->getDoctrine()->getManager()->getConnection()->query('SELECT version();')->fetchColumn();
+        var_dump($version);
+
         return $this->render(
             'WallabagCoreBundle:Entry:entry.html.twig',
             ['entry' => $entry]
index 8dcc719053667a9358dd093440d1cb2d224476a9..4c22cf9c2663ab337011aa62f9860fc5ff63abb1 100644 (file)
@@ -22,8 +22,10 @@ use Wallabag\AnnotationBundle\Entity\Annotation;
  * @ORM\Table(
  *     name="`entry`",
  *     options={"collate"="utf8mb4_unicode_ci", "charset"="utf8mb4"},
- *     indexes={@ORM\Index(name="created_at", columns={"created_at"})},
- *     indexes={@ORM\Index(name="uuid", columns={"uuid"})}
+ *     indexes={
+ *         @ORM\Index(name="created_at", columns={"created_at"}),
+ *         @ORM\Index(name="uuid", columns={"uuid"})
+ *     }
  * )
  * @ORM\HasLifecycleCallbacks()
  * @Hateoas\Relation("self", href = "expr('/api/entries/' ~ object.getId())")
@@ -45,7 +47,7 @@ class Entry
     /**
      * @var string
      *
-     * @ORM\Column(name="uuid", type="text", nullable=true)
+     * @ORM\Column(name="uuid", type="guid", nullable=true)
      *
      * @Groups({"entries_for_user", "export_all"})
      */
index c347cca5ad2ab05ba2acb3783fa432fd2ad13307..10cda475c29cc114f0ad934fdac8f3e3b48a32d8 100644 (file)
@@ -816,6 +816,7 @@ class EntryControllerTest extends WallabagCoreTestCase
 
         // generating the uuid
         $client->request('GET', '/share/'.$content->getId());
+        var_dump($client->getResponse()->getContent());
         $this->assertEquals(302, $client->getResponse()->getStatusCode());
 
         // follow link with uuid