<?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 Version20260119165558 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 ADD channel ENUM(\'email\', \'sms\') DEFAULT NULL COMMENT \'(DC2Type:MessageAutomationChannelType)\', ADD audience ENUM(\'both\', \'lead\', \'customer\') DEFAULT NULL COMMENT \'(DC2Type:MessageAutomationAudienceType)\', ADD delay_days INT DEFAULT NULL');
$this->addSql('UPDATE message_automation SET channel = \'email\' WHERE channel IS NULL');
$this->addSql('UPDATE message_automation SET audience = \'both\' WHERE audience IS NULL');
$this->addSql('UPDATE message_automation SET delay_days = 0 WHERE delay_days IS NULL');
$this->addSql('UPDATE message_automation SET channel = \'sms\', audience = \'lead\', delay_days = 0 WHERE token = \'lead-inbound-sms\'');
$this->addSql('UPDATE message_automation SET channel = \'email\', audience = \'lead\', delay_days = 0 WHERE token = \'lead-inbound-email\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE message_automation DROP channel, DROP audience, DROP delay_days');
}
}