<?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 Version20210207191012 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 echange DROP FOREIGN KEY FK_B577E3BF54C056EB');
$this->addSql('ALTER TABLE echange DROP FOREIGN KEY FK_B577E3BFE7A1254A');
$this->addSql('DROP INDEX IDX_B577E3BF54C056EB ON echange');
$this->addSql('DROP INDEX IDX_B577E3BFE7A1254A ON echange');
$this->addSql('ALTER TABLE echange DROP promoteur_id, DROP contact_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 echange ADD promoteur_id INT NOT NULL, ADD contact_id INT NOT NULL');
$this->addSql('ALTER TABLE echange ADD CONSTRAINT FK_B577E3BF54C056EB FOREIGN KEY (promoteur_id) REFERENCES app_users (id)');
$this->addSql('ALTER TABLE echange ADD CONSTRAINT FK_B577E3BFE7A1254A FOREIGN KEY (contact_id) REFERENCES app_users (id)');
$this->addSql('CREATE INDEX IDX_B577E3BF54C056EB ON echange (promoteur_id)');
$this->addSql('CREATE INDEX IDX_B577E3BFE7A1254A ON echange (contact_id)');
}
}