<?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 Version20260107090352 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('CREATE TABLE crm_alert (id INT AUTO_INCREMENT NOT NULL, resolved_by_id INT DEFAULT NULL, type VARCHAR(100) NOT NULL, resource_type VARCHAR(50) NOT NULL, resource_id INT NOT NULL, severity VARCHAR(20) NOT NULL, status VARCHAR(20) NOT NULL, message VARCHAR(255) NOT NULL, metadata LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', resolved_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_ABF419F96713A32B (resolved_by_id), INDEX idx_crm_alert_status (status), INDEX idx_crm_alert_resource (resource_type, resource_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE crm_alert ADD CONSTRAINT FK_ABF419F96713A32B FOREIGN KEY (resolved_by_id) REFERENCES app_user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE app_payment_history ADD INDEX `idx_app_payment_history_installment_user` (`is_installment`);');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
}