<?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 Version20200830201526 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE billing_address DROP FOREIGN KEY FK_46EA8399A455ACCF');
$this->addSql('DROP INDEX IDX_6660E456A455ACCF ON billing_address');
$this->addSql('ALTER TABLE billing_address CHANGE idclient customer_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE billing_address ADD CONSTRAINT FK_6660E4569395C3F3 FOREIGN KEY (customer_id) REFERENCES clients (id)');
$this->addSql('CREATE INDEX IDX_6660E4569395C3F3 ON billing_address (customer_id)');
$this->addSql('ALTER TABLE street_address DROP FOREIGN KEY FK_52AFD022A455ACCF');
$this->addSql('DROP INDEX IDX_52AFD022A455ACCF ON street_address');
$this->addSql('ALTER TABLE street_address CHANGE idclient customer_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE street_address ADD CONSTRAINT FK_52AFD0229395C3F3 FOREIGN KEY (customer_id) REFERENCES clients (id)');
$this->addSql('CREATE INDEX IDX_52AFD0229395C3F3 ON street_address (customer_id)');
$this->addSql('ALTER TABLE accounting_entry DROP FOREIGN KEY FK_DB6C942AA455ACCF');
$this->addSql('DROP INDEX IDX_DB6C942AA455ACCF ON accounting_entry');
$this->addSql('ALTER TABLE accounting_entry CHANGE idclient customer_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE accounting_entry ADD CONSTRAINT FK_DB6C942A9395C3F3 FOREIGN KEY (customer_id) REFERENCES clients (id)');
$this->addSql('CREATE INDEX IDX_DB6C942A9395C3F3 ON accounting_entry (customer_id)');
$this->addSql('ALTER TABLE claim DROP FOREIGN KEY FK_A769DE27A455ACCF');
$this->addSql('DROP INDEX IDX_A769DE27A455ACCF ON claim');
$this->addSql('ALTER TABLE claim CHANGE idclient customer_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE claim ADD CONSTRAINT FK_A769DE279395C3F3 FOREIGN KEY (customer_id) REFERENCES clients (id)');
$this->addSql('CREATE INDEX IDX_A769DE279395C3F3 ON claim (customer_id)');
$this->addSql('ALTER TABLE trackings DROP FOREIGN KEY FK_FA7EF26A455ACCF');
$this->addSql('DROP INDEX IDX_FA7EF26A455ACCF ON trackings');
$this->addSql('ALTER TABLE trackings CHANGE idclient customer_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE trackings ADD CONSTRAINT FK_FA7EF269395C3F3 FOREIGN KEY (customer_id) REFERENCES clients (id)');
$this->addSql('CREATE INDEX IDX_FA7EF269395C3F3 ON trackings (customer_id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE accounting_entry DROP FOREIGN KEY FK_DB6C942A9395C3F3');
$this->addSql('DROP INDEX IDX_DB6C942A9395C3F3 ON accounting_entry');
$this->addSql('ALTER TABLE accounting_entry CHANGE customer_id idClient INT DEFAULT NULL');
$this->addSql('ALTER TABLE accounting_entry ADD CONSTRAINT FK_DB6C942AA455ACCF FOREIGN KEY (idClient) REFERENCES clients (id)');
$this->addSql('CREATE INDEX IDX_DB6C942AA455ACCF ON accounting_entry (idClient)');
$this->addSql('ALTER TABLE billing_address DROP FOREIGN KEY FK_6660E4569395C3F3');
$this->addSql('DROP INDEX IDX_6660E4569395C3F3 ON billing_address');
$this->addSql('ALTER TABLE billing_address CHANGE customer_id idClient INT DEFAULT NULL');
$this->addSql('ALTER TABLE billing_address ADD CONSTRAINT FK_46EA8399A455ACCF FOREIGN KEY (idClient) REFERENCES clients (id)');
$this->addSql('CREATE INDEX IDX_6660E456A455ACCF ON billing_address (idClient)');
$this->addSql('ALTER TABLE claim DROP FOREIGN KEY FK_A769DE279395C3F3');
$this->addSql('DROP INDEX IDX_A769DE279395C3F3 ON claim');
$this->addSql('ALTER TABLE claim CHANGE customer_id idClient INT DEFAULT NULL');
$this->addSql('ALTER TABLE claim ADD CONSTRAINT FK_A769DE27A455ACCF FOREIGN KEY (idClient) REFERENCES clients (id)');
$this->addSql('CREATE INDEX IDX_A769DE27A455ACCF ON claim (idClient)');
$this->addSql('ALTER TABLE street_address DROP FOREIGN KEY FK_52AFD0229395C3F3');
$this->addSql('DROP INDEX IDX_52AFD0229395C3F3 ON street_address');
$this->addSql('ALTER TABLE street_address CHANGE customer_id idClient INT DEFAULT NULL');
$this->addSql('ALTER TABLE street_address ADD CONSTRAINT FK_52AFD022A455ACCF FOREIGN KEY (idClient) REFERENCES clients (id)');
$this->addSql('CREATE INDEX IDX_52AFD022A455ACCF ON street_address (idClient)');
$this->addSql('ALTER TABLE trackings DROP FOREIGN KEY FK_FA7EF269395C3F3');
$this->addSql('DROP INDEX IDX_FA7EF269395C3F3 ON trackings');
$this->addSql('ALTER TABLE trackings CHANGE customer_id idClient INT DEFAULT NULL');
$this->addSql('ALTER TABLE trackings ADD CONSTRAINT FK_FA7EF26A455ACCF FOREIGN KEY (idClient) REFERENCES clients (id)');
$this->addSql('CREATE INDEX IDX_FA7EF26A455ACCF ON trackings (idClient)');
}
}