X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=app%2FDoctrineMigrations%2FVersion20170510082609.php;h=ddc894a659f60bf4558da8a2e44cbe4e85b384a9;hb=8668796106b856ca041512af27268ce6e49d2caf;hp=52c70168c19c86afcc43b8512bc6eccc18a14ef9;hpb=d8dc7372ab3d8ac4c5d5546e5c5e00bf4bf2d862;p=github%2Fwallabag%2Fwallabag.git diff --git a/app/DoctrineMigrations/Version20170510082609.php b/app/DoctrineMigrations/Version20170510082609.php index 52c70168..ddc894a6 100644 --- a/app/DoctrineMigrations/Version20170510082609.php +++ b/app/DoctrineMigrations/Version20170510082609.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; /** * Changed length for username, username_canonical, email and email_canonical fields in wallabag_user table. */ -class Version20170510082609 extends AbstractMigration implements ContainerAwareInterface +class Version20170510082609 extends WallabagMigration { private $fields = [ 'username', @@ -19,19 +17,6 @@ class Version20170510082609 extends AbstractMigration implements ContainerAwareI 'email_canonical', ]; - /** - * @var ContainerInterface - */ - private $container; - - public function setContainer(ContainerInterface $container = null) - { - $this->container = $container; - } - - /** - * @param Schema $schema - */ public function up(Schema $schema) { $this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL'); @@ -41,9 +26,6 @@ class Version20170510082609 extends AbstractMigration implements ContainerAwareI } } - /** - * @param Schema $schema - */ public function down(Schema $schema) { $this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL'); @@ -52,9 +34,4 @@ class Version20170510082609 extends AbstractMigration implements ContainerAwareI $this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(255) NOT NULL;'); } } - - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix') . $tableName; - } }