<?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 Version20250921193216 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 user CHANGE access_customer_entity_role_interviews access_customer_entity_role_opportunities TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE user_group CHANGE access_customer_entity_role_interviews access_customer_entity_role_opportunities TINYINT(1) NOT NULL');
$this->addSql('UPDATE user SET settings = REPLACE(settings, \'s:17:"section_interview"\', \'s:19:"section_opportunity"\') WHERE settings LIKE \'%s:17:"section_interview"%\'');
$this->addSql('UPDATE user SET settings = REPLACE(settings, \'s:9:"interview"\', \'s:11:"opportunity"\') WHERE settings LIKE \'%s:9:"interview%\'');
$this->addSql('UPDATE user SET settings = REPLACE(settings, \'s:9:"interivew"\', \'s:11:"opportunity"\') WHERE settings LIKE \'%s:9:"interivew%\''); // TYPO
$this->addSql('ALTER TABLE filter CHANGE section section VARCHAR(64) NOT NULL');
$this->addSql('UPDATE filter SET section = \'section_opportunity\' WHERE section = \'section_interview\'');
$this->addSql('ALTER TABLE filter CHANGE section section ENUM(\'section_opportunity\', \'section_customer\', \'section_lead\', \'section_event\', \'section_feed\', \'section_project\', \'section_project_item\', \'section_stream\', \'section_issue\', \'section_message\', \'section_report\') NOT NULL COMMENT \'(DC2Type:SectionType)\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user CHANGE access_customer_entity_role_opportunities access_customer_entity_role_interviews TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE user_group CHANGE access_customer_entity_role_opportunities access_customer_entity_role_interviews TINYINT(1) NOT NULL');
$this->addSql('UPDATE user SET settings = REPLACE(settings, \'s:19:"section_opportunity"\', \'s:17:"section_interview"\') WHERE settings LIKE \'%s:19:"section_opportunity"%\'');
$this->addSql('UPDATE user SET settings = REPLACE(settings, \'s:11:"opportunity"\', \'s:9:"interview"\') WHERE settings LIKE \'%s:11:"opportunity%\'');
$this->addSql('ALTER TABLE filter CHANGE section section VARCHAR(64) NOT NULL');
$this->addSql('UPDATE filter SET section = \'section_interview\' WHERE section = \'section_opportunity\'');
$this->addSql('ALTER TABLE filter CHANGE section section ENUM(\'section_interview\', \'section_customer\', \'section_lead\', \'section_event\', \'section_feed\', \'section_project\', \'section_project_item\', \'section_stream\', \'section_issue\', \'section_message\', \'section_report\') NOT NULL COMMENT \'(DC2Type:SectionType)\'');
}
}