]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - app/DoctrineMigrations/Version20160410190541.php
Change share entry behavior
[github/wallabag/wallabag.git] / app / DoctrineMigrations / Version20160410190541.php
index 775dd6804a9dbd508db75c1d83261644aa5e3c9d..77c78c54357340099216d2c74a07eb1cae6d9a53 100644 (file)
@@ -26,21 +26,6 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI
     public function up(Schema $schema)
     {
         $this->addSql('ALTER TABLE `wallabag_entry` ADD `uuid` LONGTEXT DEFAULT NULL');
-
-        $em = $this->container->get('doctrine.orm.entity_manager');
-        $queryBuilder = $this->connection->createQueryBuilder();
-        $queryBuilder
-            ->select('e.uuid')
-            ->andWhere('e.uuid IS NULL');
-        $entries = $queryBuilder->execute();
-
-        /** @var Entry $entry */
-        foreach ($entries as $entry) {
-            $entry->generateUuid();
-            $em->persist($entry);
-            $em->clear();
-        }
-        $em->flush();
     }
 
     /**
@@ -48,6 +33,7 @@ class Version20160410190541 extends AbstractMigration implements ContainerAwareI
      */
     public function down(Schema $schema)
     {
+        $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'sqlite', 'This down migration can\'t be executed on SQLite databases, because SQLite don\'t support DROP COLUMN.');
         $this->addSql('ALTER TABLE `wallabag_entry` DROP `uuid`');
     }
 }