X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=app%2FDoctrineMigrations%2FVersion20170510082609.php;h=52c70168c19c86afcc43b8512bc6eccc18a14ef9;hb=9ca069a6fea67ddf2ef44601901ea3c02e3cffbe;hp=a99af2d2137be5fca61a652787787b39d7a26af9;hpb=7987816d1e83267199c170279213412c6086e665;p=github%2Fwallabag%2Fwallabag.git diff --git a/app/DoctrineMigrations/Version20170510082609.php b/app/DoctrineMigrations/Version20170510082609.php index a99af2d2..52c70168 100644 --- a/app/DoctrineMigrations/Version20170510082609.php +++ b/app/DoctrineMigrations/Version20170510082609.php @@ -29,20 +29,15 @@ class Version20170510082609 extends AbstractMigration implements ContainerAwareI $this->container = $container; } - private function getTable($tableName) - { - return $this->container->getParameter('database_table_prefix').$tableName; - } - /** * @param Schema $schema */ public function up(Schema $schema) { - $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL'); + $this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL'); foreach ($this->fields as $field) { - $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE '.$field.' '.$field.' VARCHAR(180) NOT NULL;'); + $this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(180) NOT NULL;'); } } @@ -51,10 +46,15 @@ class Version20170510082609 extends AbstractMigration implements ContainerAwareI */ public function down(Schema $schema) { - $this->skipIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'This migration only apply to MySQL'); + $this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL'); foreach ($this->fields as $field) { - $this->addSql('ALTER TABLE '.$this->getTable('user').' CHANGE '.$field.' '.$field.' VARCHAR(255) NOT NULL;'); + $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; + } }