]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - app/DoctrineMigrations/Version20161128131503.php
Fixed migrations with dash into db name
[github/wallabag/wallabag.git] / app / DoctrineMigrations / Version20161128131503.php
index f0e016c8c7b715242035ddf9fc9e469f6af57920..cd43461723380bdb10f324b519d17b4543e70042 100644 (file)
@@ -2,15 +2,13 @@
 
 namespace Application\Migrations;
 
-use Doctrine\DBAL\Migrations\AbstractMigration;
 use Doctrine\DBAL\Schema\Schema;
-use Symfony\Component\DependencyInjection\ContainerAwareInterface;
-use Symfony\Component\DependencyInjection\ContainerInterface;
+use Wallabag\CoreBundle\Doctrine\WallabagMigration;
 
 /**
  * Removed locked, credentials_expire_at and expires_at.
  */
-class Version20161128131503 extends AbstractMigration implements ContainerAwareInterface
+class Version20161128131503 extends WallabagMigration
 {
     private $fields = [
         'locked' => 'smallint',
@@ -18,21 +16,6 @@ class Version20161128131503 extends AbstractMigration implements ContainerAwareI
         'expires_at' => 'datetime',
     ];
 
-    /**
-     * @var ContainerInterface
-     */
-    private $container;
-
-    public function setContainer(ContainerInterface $container = null)
-    {
-        $this->container = $container;
-    }
-
-    private function getTable($tableName)
-    {
-        return $this->container->getParameter('database_table_prefix').$tableName;
-    }
-
     /**
      * @param Schema $schema
      */
@@ -55,7 +38,7 @@ class Version20161128131503 extends AbstractMigration implements ContainerAwareI
 
         foreach ($this->fields as $field => $type) {
             $this->skipIf($userTable->hasColumn($field), 'It seems that you already played this migration.');
-            $userTable->addColumn($field, $type);
+            $userTable->addColumn($field, $type, ['notnull' => false]);
         }
     }
 }