X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=app%2FDoctrineMigrations%2FVersion20190601125843.php;h=cbb92edc98ce5e223049353c4ebf16b29dc648b0;hb=8668796106b856ca041512af27268ce6e49d2caf;hp=341d64dc2933cdd09b3bcc8f9bea37851f5a61b1;hpb=f3bfb875e94021a93e24a41fbc0f8d86d4dee378;p=github%2Fwallabag%2Fwallabag.git diff --git a/app/DoctrineMigrations/Version20190601125843.php b/app/DoctrineMigrations/Version20190601125843.php index 341d64dc..cbb92edc 100644 --- a/app/DoctrineMigrations/Version20190601125843.php +++ b/app/DoctrineMigrations/Version20190601125843.php @@ -10,9 +10,6 @@ use Wallabag\CoreBundle\Doctrine\WallabagMigration; */ class Version20190601125843 extends WallabagMigration { - /** - * @param Schema $schema - */ public function up(Schema $schema) { $entryTable = $schema->getTable($this->getTable('entry')); @@ -30,32 +27,10 @@ class Version20190601125843 extends WallabagMigration ]); } - $entryTable->dropIndex('hashed_url_user_id'); - $entryTable->addIndex( - [ - 'user_id', - 'hashed_url', - 'hashed_given_url', - ], - 'hashed_urls_user_id', - [], - [ - // specify length for index which is required by MySQL on text field - 'lengths' => [ - // user_id - null, - // hashed_url - 40, - // hashed_given_url - 40, - ], - ] - ); + // 40 = length of sha1 field hashed_given_url + $entryTable->addIndex(['user_id', 'hashed_given_url'], 'hashed_given_url_user_id', [], ['lengths' => [null, 40]]); } - /** - * @param Schema $schema - */ public function down(Schema $schema) { $entryTable = $schema->getTable($this->getTable('entry')); @@ -68,7 +43,6 @@ class Version20190601125843 extends WallabagMigration $entryTable->dropColumn('hashed_given_url'); } - $entryTable->dropIndex('hashed_urls_user_id'); - $entryTable->addIndex(['user_id', 'hashed_url'], 'hashed_url_user_id', [], ['lengths' => [null, 40]]); + $entryTable->dropIndex('hashed_given_url_user_id'); } }