<?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 Version20260326165138 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 channel_company_contacts (id VARCHAR(36) NOT NULL, company_id VARCHAR(36) NOT NULL, contact_id VARCHAR(36) NOT NULL, behaviors JSON DEFAULT NULL COMMENT \'(DC2Type:json)\', INDEX IDX_126D19A5979B1AD6 (company_id), INDEX IDX_126D19A5E7A1254A (contact_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE channel_company_contacts ADD CONSTRAINT FK_126D19A5979B1AD6 FOREIGN KEY (company_id) REFERENCES channel_company (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE channel_company_contacts ADD CONSTRAINT FK_126D19A5E7A1254A FOREIGN KEY (contact_id) REFERENCES contacts (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 channel_company_contacts DROP FOREIGN KEY FK_126D19A5979B1AD6');
$this->addSql('ALTER TABLE channel_company_contacts DROP FOREIGN KEY FK_126D19A5E7A1254A');
$this->addSql('DROP TABLE channel_company_contacts');
}
}