X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=app%2FDoctrineMigrations%2FVersion20161128131503.php;h=cd43461723380bdb10f324b519d17b4543e70042;hb=bfe7a692261760517199a3797191fd214fc2ee6c;hp=f0e016c8c7b715242035ddf9fc9e469f6af57920;hpb=339b1e689d96b433d88ca1ad2325031841ae450d;p=github%2Fwallabag%2Fwallabag.git diff --git a/app/DoctrineMigrations/Version20161128131503.php b/app/DoctrineMigrations/Version20161128131503.php index f0e016c8..cd434617 100644 --- a/app/DoctrineMigrations/Version20161128131503.php +++ b/app/DoctrineMigrations/Version20161128131503.php @@ -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]); } } }