]> git.immae.eu Git - github/wallabag/wallabag.git/blame - app/DoctrineMigrations/Version20190511165128.php
Merge pull request #4020 from wallabag/fix/sqlite-reading-time-null
[github/wallabag/wallabag.git] / app / DoctrineMigrations / Version20190511165128.php
CommitLineData
feb239ea
KD
1<?php
2
3declare(strict_types=1);
4
5namespace Application\Migrations;
6
7use Doctrine\DBAL\Schema\Schema;
8use Wallabag\CoreBundle\Doctrine\WallabagMigration;
9
10/**
11 * Convert tab label to utf8mb4_bin (MySQL only).
12 */
13final class Version20190511165128 extends WallabagMigration
14{
15 public function up(Schema $schema): void
16 {
17 $this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
18
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;');
21 }
22
23 public function down(Schema $schema): void
24 {
25 $this->skipIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'This migration only apply to MySQL');
26
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;');
29 }
30}