migrations/Version20230523115910.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 Version20230523115910 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 type_intervention_client (type_intervention_id INT NOT NULL, client_id INT NOT NULL, INDEX IDX_AB5095DF799AAC17 (type_intervention_id), INDEX IDX_AB5095DF19EB6921 (client_id), PRIMARY KEY(type_intervention_id, client_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE type_intervention_client ADD CONSTRAINT FK_AB5095DF799AAC17 FOREIGN KEY (type_intervention_id) REFERENCES type_intervention (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE type_intervention_client ADD CONSTRAINT FK_AB5095DF19EB6921 FOREIGN KEY (client_id) REFERENCES client (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE type_intervention_client DROP FOREIGN KEY FK_AB5095DF799AAC17');
$this->addSql('ALTER TABLE type_intervention_client DROP FOREIGN KEY FK_AB5095DF19EB6921');
$this->addSql('DROP TABLE type_intervention_client');
}
}