]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Force sequence creation for postgresql
authorJeremy Benoist <jeremy.benoist@gmail.com>
Tue, 2 May 2017 06:38:22 +0000 (08:38 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Tue, 20 Jun 2017 14:03:20 +0000 (16:03 +0200)
app/DoctrineMigrations/Version20170501115751.php [moved from app/DoctrineMigrations/Version20161204115751.php with 86% similarity]

similarity index 86%
rename from app/DoctrineMigrations/Version20161204115751.php
rename to app/DoctrineMigrations/Version20170501115751.php
index 97635fa7366c2e33792bbc1ff9e41443962949f5..846a87b5c462744c1e5d663c3084fdfc32bc88ff 100644 (file)
@@ -10,7 +10,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
 /**
  * Add site credential table to store username & password for some website (behind authentication or paywall)
  */
-class Version20161204115751 extends AbstractMigration implements ContainerAwareInterface
+class Version20170501115751 extends AbstractMigration implements ContainerAwareInterface
 {
     /**
      * @var ContainerInterface
@@ -44,6 +44,11 @@ class Version20161204115751 extends AbstractMigration implements ContainerAwareI
         $table->addIndex(['user_id'], 'idx_user');
         $table->setPrimaryKey(['id']);
         $table->addForeignKeyConstraint($this->getTable('user'), ['user_id'], ['id'], [], 'fk_user');
+
+        if ('postgresql' === $this->connection->getDatabasePlatform()->getName()) {
+            $schema->dropSequence('site_credential_id_seq');
+            $schema->createSequence('site_credential_id_seq');
+        }
     }
 
     /**