<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230605105500 extends AbstractMigration
{
public function getDescription(): string
{
return 'Rename federation table to sport_federation';
}
public function up(Schema $schema): void
{
$this->skipIf(
true === $schema->hasTable('sport_federation'),
'The sport_federation table already exist!'
);
$schema->renameTable('federation', 'sport_federation');
$schema->renameTable('federation_health_mutual', 'sport_federation_health_mutual');
}
public function down(Schema $schema): void
{
$this->skipIf(
true === $schema->hasTable('federation'),
'The federation table already exist!'
);
$schema->renameTable('sport_federation', 'federation');
$schema->renameTable('sport_federation_health_mutual', 'federation_health_mutual');
}
}