]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - app/DoctrineMigrations/Version20190401105353.php
Merge pull request #4254 from Simounet/feat/sidebar-sub-entries-no-hover
[github/wallabag/wallabag.git] / app / DoctrineMigrations / Version20190401105353.php
index c1c220537e21be19530301e84adbb52b7af79a2e..600fc162152ca9662b22df7f83971893b17cdf34 100644 (file)
@@ -10,9 +10,6 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration;
  */
 class Version20190401105353 extends WallabagMigration
 {
-    /**
-     * @param Schema $schema
-     */
     public function up(Schema $schema)
     {
         $entryTable = $schema->getTable($this->getTable('entry'));
@@ -24,17 +21,9 @@ class Version20190401105353 extends WallabagMigration
             'notnull' => false,
         ]);
 
-        // sqlite doesn't have the MD5 function by default
-        if ('sqlite' !== $this->connection->getDatabasePlatform()->getName()) {
-            $this->addSql('UPDATE ' . $this->getTable('entry') . ' SET hashed_url = MD5(url)');
-        }
-
-        $entryTable->addIndex(['user_id', 'hashed_url'], 'hashed_url_user_id');
+        $entryTable->addIndex(['user_id', 'hashed_url'], 'hashed_url_user_id', [], ['lengths' => [null, 40]]);
     }
 
-    /**
-     * @param Schema $schema
-     */
     public function down(Schema $schema)
     {
         $entryTable = $schema->getTable($this->getTable('entry'));