3 namespace Application\Migrations
;
5 use Doctrine\DBAL\Schema\Schema
;
6 use Wallabag\CoreBundle\Doctrine\WallabagMigration
;
9 * Changed length for username, username_canonical, email and email_canonical fields in wallabag_user table.
11 class Version20170510082609
extends WallabagMigration
21 * @param Schema $schema
23 public function up(Schema
$schema)
25 $this->skipIf('mysql' !== $this->connection
->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
27 foreach ($this->fields
as $field) {
28 $this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(180) NOT NULL;');
33 * @param Schema $schema
35 public function down(Schema
$schema)
37 $this->skipIf('mysql' !== $this->connection
->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
39 foreach ($this->fields
as $field) {
40 $this->addSql('ALTER TABLE ' . $this->getTable('user') . ' CHANGE ' . $field . ' ' . $field . ' VARCHAR(255) NOT NULL;');