<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
final class Version20211116204832 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('CREATE TABLE client_group (client_id INT NOT NULL, group_id INT NOT NULL, INDEX IDX_CEADD87219EB6921 (client_id), INDEX IDX_CEADD872FE54D947 (group_id), PRIMARY KEY(client_id, group_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE client_group ADD CONSTRAINT FK_CEADD87219EB6921 FOREIGN KEY (client_id) REFERENCES `mallette_client` (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE client_group ADD CONSTRAINT FK_CEADD872FE54D947 FOREIGN KEY (group_id) REFERENCES `mallette_group` (id) ON DELETE CASCADE');
$this->addSql('DROP TABLE group_client');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE group_client (group_id INT NOT NULL, client_id INT NOT NULL, INDEX IDX_14C2DC8519EB6921 (client_id), INDEX IDX_14C2DC85FE54D947 (group_id), PRIMARY KEY(group_id, client_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE group_client ADD CONSTRAINT FK_14C2DC8519EB6921 FOREIGN KEY (client_id) REFERENCES mallette_client (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE group_client ADD CONSTRAINT FK_14C2DC85FE54D947 FOREIGN KEY (group_id) REFERENCES mallette_group (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('DROP TABLE client_group');
}
public function isTransactional(): bool
{
return false;
}
}