3 namespace Application\Migrations
;
5 use Doctrine\DBAL\Schema\Schema
;
6 use Wallabag\CoreBundle\Doctrine\WallabagMigration
;
9 * Added index on wallabag_entry.uid.
11 class Version20161214094403
extends WallabagMigration
13 private $indexName = 'IDX_entry_uid';
15 public function up(Schema
$schema)
17 $entryTable = $schema->getTable($this->getTable('entry'));
18 $this->skipIf($entryTable->hasIndex($this->indexName
), 'It seems that you already played this migration.');
20 $entryTable->addIndex(['uid'], $this->indexName
);
23 public function down(Schema
$schema)
25 $entryTable = $schema->getTable($this->getTable('entry'));
26 $this->skipIf(false === $entryTable->hasIndex($this->indexName
), 'It seems that you already played this migration.');
28 $entryTable->dropIndex($this->indexName
);