migrations/Version20260119165558.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20260119165558 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $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');
  19.         $this->addSql('UPDATE message_automation SET channel = \'email\' WHERE channel IS NULL');
  20.         $this->addSql('UPDATE message_automation SET audience = \'both\' WHERE audience IS NULL');
  21.         $this->addSql('UPDATE message_automation SET delay_days = 0 WHERE delay_days IS NULL');
  22.         $this->addSql('UPDATE message_automation SET channel = \'sms\', audience = \'lead\', delay_days = 0 WHERE token = \'lead-inbound-sms\'');
  23.         $this->addSql('UPDATE message_automation SET channel = \'email\', audience = \'lead\', delay_days = 0 WHERE token = \'lead-inbound-email\'');
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         // this down() migration is auto-generated, please modify it to your needs
  28.         $this->addSql('ALTER TABLE message_automation DROP channel, DROP audience, DROP delay_days');
  29.     }
  30. }