]> git.immae.eu Git - github/wallabag/wallabag.git/blame - app/DoctrineMigrations/Version20161214094403.php
Merge pull request #4438 from wallabag/dependabot/composer/scheb/two-factor-bundle...
[github/wallabag/wallabag.git] / app / DoctrineMigrations / Version20161214094403.php
CommitLineData
74b7c098
NL
1<?php
2
3namespace Application\Migrations;
4
74b7c098 5use Doctrine\DBAL\Schema\Schema;
bfe7a692 6use Wallabag\CoreBundle\Doctrine\WallabagMigration;
74b7c098
NL
7
8/**
01736b5a 9 * Added index on wallabag_entry.uid.
74b7c098 10 */
bfe7a692 11class Version20161214094403 extends WallabagMigration
74b7c098 12{
7239082a 13 private $indexName = 'IDX_entry_uid';
74b7c098 14
74b7c098
NL
15 public function up(Schema $schema)
16 {
17 $entryTable = $schema->getTable($this->getTable('entry'));
18 $this->skipIf($entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.');
19
7239082a 20 $entryTable->addIndex(['uid'], $this->indexName);
74b7c098
NL
21 }
22
74b7c098
NL
23 public function down(Schema $schema)
24 {
25 $entryTable = $schema->getTable($this->getTable('entry'));
26 $this->skipIf(false === $entryTable->hasIndex($this->indexName), 'It seems that you already played this migration.');
27
28 $entryTable->dropIndex($this->indexName);
29 }
30}