migrations/Version20230531125529.php line 1
<?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 Version20230531125529 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 client_nom_de_domaine DROP FOREIGN KEY FK_643BFEB719EB6921');
$this->addSql('ALTER TABLE client_nom_de_domaine DROP FOREIGN KEY FK_643BFEB7B72FEAC7');
$this->addSql('DROP TABLE client_nom_de_domaine');
$this->addSql('ALTER TABLE nom_de_domaine ADD client_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE nom_de_domaine ADD CONSTRAINT FK_45F8BC3819EB6921 FOREIGN KEY (client_id) REFERENCES client (id)');
$this->addSql('CREATE INDEX IDX_45F8BC3819EB6921 ON nom_de_domaine (client_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE client_nom_de_domaine (client_id INT NOT NULL, nom_de_domaine_id INT NOT NULL, INDEX IDX_643BFEB7B72FEAC7 (nom_de_domaine_id), INDEX IDX_643BFEB719EB6921 (client_id), PRIMARY KEY(client_id, nom_de_domaine_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE client_nom_de_domaine ADD CONSTRAINT FK_643BFEB719EB6921 FOREIGN KEY (client_id) REFERENCES client (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE client_nom_de_domaine ADD CONSTRAINT FK_643BFEB7B72FEAC7 FOREIGN KEY (nom_de_domaine_id) REFERENCES nom_de_domaine (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE nom_de_domaine DROP FOREIGN KEY FK_45F8BC3819EB6921');
$this->addSql('DROP INDEX IDX_45F8BC3819EB6921 ON nom_de_domaine');
$this->addSql('ALTER TABLE nom_de_domaine DROP client_id');
}
}