3 declare(strict_types
=1);
5 namespace Application\Migrations
;
7 use Doctrine\DBAL\Schema\Schema
;
8 use Wallabag\CoreBundle\Doctrine\WallabagMigration
;
11 * Convert tab label to utf8mb4_bin (MySQL only).
13 final class Version20190511165128
extends WallabagMigration
15 public function up(Schema
$schema): void
17 $this->skipIf('mysql' !== $this->connection
->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
19 $this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
20 $this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `slug` `slug` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;');
23 public function down(Schema
$schema): void
25 $this->skipIf('mysql' !== $this->connection
->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
27 $this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `slug` `slug` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');
28 $this->addSql('ALTER TABLE ' . $this->getTable('tag') . ' CHANGE `label` `label` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;');