aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2017-01-27 12:10:52 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2017-01-27 14:11:21 +0100
commit01e760691b72b3c3e63ac79a18da2c8efad42558 (patch)
treefa5a32d4f73cb2740a871230d9685bbeb50f269d
parentb564d350b0d3ca5f8b5928c87272c55ff3c92b19 (diff)
downloadwallabag-01e760691b72b3c3e63ac79a18da2c8efad42558.tar.gz
wallabag-01e760691b72b3c3e63ac79a18da2c8efad42558.tar.zst
wallabag-01e760691b72b3c3e63ac79a18da2c8efad42558.zip
Fixed check on index
-rw-r--r--app/DoctrineMigrations/Version20170127093841.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/DoctrineMigrations/Version20170127093841.php b/app/DoctrineMigrations/Version20170127093841.php
index 384529a1..20c79479 100644
--- a/app/DoctrineMigrations/Version20170127093841.php
+++ b/app/DoctrineMigrations/Version20170127093841.php
@@ -36,8 +36,7 @@ class Version20170127093841 extends AbstractMigration implements ContainerAwareI
36 public function up(Schema $schema) 36 public function up(Schema $schema)
37 { 37 {
38 $entryTable = $schema->getTable($this->getTable('entry')); 38 $entryTable = $schema->getTable($this->getTable('entry'));
39 $this->skipIf($entryTable->hasIndex($this->indexStarredName), 'It seems that you already played this migration.'); 39 $this->skipIf($entryTable->hasIndex($this->indexStarredName) && $entryTable->hasIndex($this->indexArchivedName), 'It seems that you already played this migration.');
40 $this->skipIf($entryTable->hasIndex($this->indexStarredName), 'It seems that you already played this migration.');
41 40
42 $entryTable->addIndex(['is_starred'], $this->indexStarredName); 41 $entryTable->addIndex(['is_starred'], $this->indexStarredName);
43 $entryTable->addIndex(['is_archived'], $this->indexArchivedName); 42 $entryTable->addIndex(['is_archived'], $this->indexArchivedName);
@@ -49,8 +48,7 @@ class Version20170127093841 extends AbstractMigration implements ContainerAwareI
49 public function down(Schema $schema) 48 public function down(Schema $schema)
50 { 49 {
51 $entryTable = $schema->getTable($this->getTable('entry')); 50 $entryTable = $schema->getTable($this->getTable('entry'));
52 $this->skipIf(false === $entryTable->hasIndex($this->indexStarredName), 'It seems that you already played this migration.'); 51 $this->skipIf(false === $entryTable->hasIndex($this->indexStarredName) && false === $entryTable->hasIndex($this->indexArchivedName), 'It seems that you already played this migration.');
53 $this->skipIf(false === $entryTable->hasIndex($this->indexStarredName), 'It seems that you already played this migration.');
54 52
55 $entryTable->dropIndex($this->indexStarredName); 53 $entryTable->dropIndex($this->indexStarredName);
56 $entryTable->dropIndex($this->indexArchivedName); 54 $entryTable->dropIndex($this->indexArchivedName);