<?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 Version20260209164212 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('RENAME TABLE contact TO lead_prospect');
$this->addSql('ALTER TABLE lead_prospect RENAME INDEX idx_4c62e638a76ed395 TO IDX_639D0E7EA76ED395');
$this->addSql('DELETE FROM filter WHERE section = \'section_contact\'');
$this->addSql('ALTER TABLE filter CHANGE section section ENUM(\'section_lead\', \'section_opportunity\', \'section_customer\', \'section_event\', \'section_feed\', \'section_project\', \'section_project_item\', \'section_stream\', \'section_issue\', \'section_message\', \'section_report\') NOT NULL COMMENT \'(DC2Type:SectionType)\'');
$this->addSql('ALTER TABLE message_automation CHANGE event event VARCHAR(255) DEFAULT NULL');
$this->addSql('UPDATE message_automation SET event = \'prospect.created\' WHERE event = \'contact.created\'');
$this->addSql('ALTER TABLE message_automation CHANGE event event ENUM(\'prospect.created\', \'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('RENAME TABLE lead_prospect TO contact');
$this->addSql('ALTER TABLE lead_prospect RENAME INDEX idx_639d0e7ea76ed395 TO IDX_4C62E638A76ED395');
$this->addSql('ALTER TABLE filter CHANGE section section ENUM(\'section_contact\', \'section_lead\', \'section_opportunity\', \'section_customer\', \'section_event\', \'section_feed\', \'section_project\', \'section_project_item\', \'section_stream\', \'section_issue\', \'section_message\', \'section_report\') NOT NULL COMMENT \'(DC2Type:SectionType)\'');
$this->addSql('ALTER TABLE message_automation CHANGE event event VARCHAR(255) DEFAULT NULL');
$this->addSql('UPDATE message_automation SET event = \'contact.created\' WHERE event = \'prospect.created\'');
$this->addSql('ALTER TABLE message_automation CHANGE event event ENUM(\'contact.created\', \'lead.created\', \'opportunity.created\', \'customer.created\') DEFAULT NULL COMMENT \'(DC2Type:MessageAutomationEventType)\'');
}
}