<?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 Version20260122165345 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 message_automation CHANGE event event VARCHAR(255) DEFAULT NULL');
$this->addSql('DELETE FROM message_automation WHERE event = \'lead.closed\'');
$this->addSql('UPDATE message_automation SET event = \'opportunity.created\' WHERE event = \'lead.converted\'');
$this->addSql('UPDATE message_automation SET event = NULL WHERE event NOT IN (\'lead.created\', \'opportunity.created\', \'customer.created\')');
$this->addSql('ALTER TABLE message_automation CHANGE event event ENUM(\'lead.created\', \'opportunity.created\', \'customer.created\') DEFAULT NULL COMMENT \'(DC2Type:MessageAutomationEventType)\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE message_automation CHANGE event event VARCHAR(255) DEFAULT NULL');
$this->addSql('UPDATE message_automation SET event = \'lead.converted\' WHERE event = \'opportunity.created\'');
$this->addSql('UPDATE message_automation SET event = NULL WHERE event NOT IN (\'lead.created\', \'lead.closed\', \'lead.converted\', \'customer.created\')');
$this->addSql('ALTER TABLE message_automation CHANGE event event ENUM(\'lead.created\', \'lead.closed\', \'lead.converted\', \'customer.created\') DEFAULT NULL COMMENT \'(DC2Type:MessageAutomationEventType)\'');
}
}