Version20210118153932.php 886 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. declare(strict_types=1);
  3. namespace ShlinkMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20210118153932 extends AbstractMigration
  7. {
  8. public function up(Schema $schema): void
  9. {
  10. // Prev migration used to set the length to 256, which made some set-ups crash
  11. // It has been updated to 255, and this migration ensures whoever managed to run the prev one, gets the value
  12. // also updated to 255
  13. $rolesTable = $schema->getTable('api_key_roles');
  14. $nameColumn = $rolesTable->getColumn('role_name');
  15. $nameColumn->setLength(255);
  16. }
  17. public function down(Schema $schema): void
  18. {
  19. }
  20. /**
  21. * @fixme Workaround for https://github.com/doctrine/migrations/issues/1104
  22. */
  23. public function isTransactional(): bool
  24. {
  25. return false;
  26. }
  27. }