]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - app/DoctrineMigrations/Version20161104073720.php
Added dropColumn for SQLite and some enhancements
[github/wallabag/wallabag.git] / app / DoctrineMigrations / Version20161104073720.php
index 7a0361f80176a806b1bf27c465ec6cb77138b3c9..cd2029cb301f91c941fd53ff1063f966bdab26c6 100644 (file)
@@ -29,18 +29,8 @@ class Version20161104073720 extends AbstractMigration implements ContainerAwareI
      */
     public function up(Schema $schema)
     {
-        switch ($this->connection->getDatabasePlatform()->getName()) {
-            case 'sqlite':
-                $this->addSql('CREATE INDEX `created_at` ON `'.$this->getTable('entry').'` (`created_at` DESC)');
-                break;
-
-            case 'mysql':
-                $this->addSql('ALTER TABLE '.$this->getTable('entry').' ADD INDEX created_at (created_at);');
-                break;
-
-            case 'postgresql':
-                $this->addSql('CREATE INDEX created_at ON '.$this->getTable('entry').' (created_at DESC)');
-        }
+        $entryTable = $schema->getTable($this->getTable('entry'));
+        $entryTable->addIndex(['created_at']);
     }
 
     /**