<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220430155716 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE clients DROP FOREIGN KEY FK_C82E7485E73F45');
$this->addSql('DROP INDEX IDX_C82E7485E73F45 ON clients');
$this->addSql('ALTER TABLE clients CHANGE county_id city_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE clients ADD CONSTRAINT FK_C82E748BAC62AF FOREIGN KEY (city_id) REFERENCES cities (id)');
$this->addSql('CREATE INDEX IDX_C82E748BAC62AF ON clients (city_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE clients DROP FOREIGN KEY FK_C82E748BAC62AF');
$this->addSql('DROP INDEX IDX_C82E748BAC62AF ON clients');
$this->addSql('ALTER TABLE clients CHANGE city_id county_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE clients ADD CONSTRAINT FK_C82E7485E73F45 FOREIGN KEY (county_id) REFERENCES counties (id)');
$this->addSql('CREATE INDEX IDX_C82E7485E73F45 ON clients (county_id)');
}
}