<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20260401000001 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create notification_event_rules table';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE notification_event_rules (
id INT AUTO_INCREMENT NOT NULL,
notification_system_id INT NOT NULL,
trigger_timing VARCHAR(50) NOT NULL,
trigger_values JSON DEFAULT NULL,
status_condition JSON DEFAULT NULL,
is_enabled TINYINT(1) NOT NULL DEFAULT 1,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
deleted_at DATETIME DEFAULT NULL,
PRIMARY KEY(id),
INDEX idx_ner_trigger_timing (trigger_timing),
INDEX idx_ner_is_enabled (is_enabled),
INDEX idx_ner_notification_system_id (notification_system_id),
CONSTRAINT fk_ner_notification_system
FOREIGN KEY (notification_system_id)
REFERENCES notification_system (id)
ON DELETE CASCADE
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE notification_event_rules');
}
}