<?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 Version20210808063046 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('DROP TABLE clients_pitch');
$this->addSql('ALTER TABLE clients ADD pitch_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE clients ADD CONSTRAINT FK_C82E74FEEFC64B FOREIGN KEY (pitch_id) REFERENCES pitch (id)');
$this->addSql('CREATE INDEX IDX_C82E74FEEFC64B ON clients (pitch_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE clients_pitch (clients_id INT NOT NULL, pitch_id INT NOT NULL, INDEX IDX_F01C4A1EFEEFC64B (pitch_id), INDEX IDX_F01C4A1EAB014612 (clients_id), PRIMARY KEY(clients_id, pitch_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE clients_pitch ADD CONSTRAINT FK_F01C4A1EAB014612 FOREIGN KEY (clients_id) REFERENCES clients (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE clients_pitch ADD CONSTRAINT FK_F01C4A1EFEEFC64B FOREIGN KEY (pitch_id) REFERENCES pitch (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE clients DROP FOREIGN KEY FK_C82E74FEEFC64B');
$this->addSql('DROP INDEX IDX_C82E74FEEFC64B ON clients');
$this->addSql('ALTER TABLE clients DROP pitch_id');
}
}