2021-01-18 19:14:46 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace ShlinkMigrations;
|
|
|
|
|
2022-01-10 14:05:01 +03:00
|
|
|
use Doctrine\DBAL\Platforms\MySQLPlatform;
|
2021-01-18 19:14:46 +03:00
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
|
|
|
|
final class Version20210118153932 extends AbstractMigration
|
|
|
|
{
|
|
|
|
public function up(Schema $schema): void
|
|
|
|
{
|
|
|
|
// Prev migration used to set the length to 256, which made some set-ups crash
|
|
|
|
// It has been updated to 255, and this migration ensures whoever managed to run the prev one, gets the value
|
|
|
|
// also updated to 255
|
|
|
|
|
|
|
|
$rolesTable = $schema->getTable('api_key_roles');
|
|
|
|
$nameColumn = $rolesTable->getColumn('role_name');
|
|
|
|
$nameColumn->setLength(255);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function down(Schema $schema): void
|
|
|
|
{
|
|
|
|
}
|
2021-10-23 17:02:29 +03:00
|
|
|
|
|
|
|
public function isTransactional(): bool
|
|
|
|
{
|
2022-01-10 14:05:01 +03:00
|
|
|
return ! ($this->connection->getDatabasePlatform() instanceof MySQLPlatform);
|
2021-10-23 17:02:29 +03:00
|
|
|
}
|
2021-01-18 19:14:46 +03:00
|
|
|
}
|