2018-11-28 19:26:18 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Application\Migrations;
|
|
|
|
|
2023-08-05 17:35:09 +00:00
|
|
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
2018-11-28 19:26:18 +00:00
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
2024-02-19 00:30:12 +00:00
|
|
|
use Wallabag\Doctrine\WallabagMigration;
|
2018-11-28 19:26:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Fix varchar field from vendor to work with utf8mb4.
|
|
|
|
*/
|
|
|
|
class Version20181128203230 extends WallabagMigration
|
|
|
|
{
|
2022-12-14 13:36:29 +00:00
|
|
|
public function up(Schema $schema): void
|
2018-11-28 19:26:18 +00:00
|
|
|
{
|
2024-02-18 22:47:34 +00:00
|
|
|
if (!$this->connection->getDatabasePlatform() instanceof MySQLPlatform) {
|
|
|
|
$this->write('This migration can only be applied on \'mysql\'.');
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
2018-11-28 19:26:18 +00:00
|
|
|
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `token` `token` varchar(191) NOT NULL');
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `scope` `scope` varchar(191)');
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' CHANGE `token` `token` varchar(191) NOT NULL');
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' CHANGE `scope` `scope` varchar(191)');
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_refresh_tokens') . ' CHANGE `token` `token` varchar(191) NOT NULL');
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_refresh_tokens') . ' CHANGE `scope` `scope` varchar(191)');
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' CHANGE `name` `name` varchar(191)');
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' CHANGE `section` `section` varchar(191)');
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' CHANGE `value` `value` varchar(191)');
|
|
|
|
}
|
|
|
|
|
2022-12-14 13:36:29 +00:00
|
|
|
public function down(Schema $schema): void
|
2018-11-28 19:26:18 +00:00
|
|
|
{
|
2024-02-18 22:47:34 +00:00
|
|
|
if (!$this->connection->getDatabasePlatform() instanceof MySQLPlatform) {
|
|
|
|
$this->write('This migration can only be applied on \'mysql\'.');
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
2018-11-28 19:26:18 +00:00
|
|
|
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `token` `token` varchar(255) NOT NULL');
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_access_tokens') . ' CHANGE `scope` `scope` varchar(255)');
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' CHANGE `token` `token` varchar(255) NOT NULL');
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_auth_codes') . ' CHANGE `scope` `scope` varchar(255)');
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_refresh_tokens') . ' CHANGE `token` `token` varchar(255) NOT NULL');
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('oauth2_refresh_tokens') . ' CHANGE `scope` `scope` varchar(255)');
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' CHANGE `name` `name` varchar(255)');
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' CHANGE `section` `section` varchar(255)');
|
|
|
|
$this->addSql('ALTER TABLE ' . $this->getTable('craue_config_setting') . ' CHANGE `value` `value` varchar(255)');
|
|
|
|
}
|
|
|
|
}
|