migrations/Version20230605105500.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20230605105500 extends AbstractMigration
  7. {
  8.     public function getDescription(): string
  9.     {
  10.         return 'Rename federation table to sport_federation';
  11.     }
  12.     public function up(Schema $schema): void
  13.     {
  14.         $this->skipIf(
  15.             true === $schema->hasTable('sport_federation'),
  16.             'The sport_federation table already exist!'
  17.         );
  18.         $schema->renameTable('federation''sport_federation');
  19.         $schema->renameTable('federation_health_mutual''sport_federation_health_mutual');
  20.     }
  21.     public function down(Schema $schema): void
  22.     {
  23.         $this->skipIf(
  24.             true === $schema->hasTable('federation'),
  25.             'The federation table already exist!'
  26.         );
  27.         $schema->renameTable('sport_federation''federation');
  28.         $schema->renameTable('sport_federation_health_mutual''federation_health_mutual');
  29.     }
  30. }