migrations/Version20250715000006.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. final class Version20250715000006 extends AbstractMigration
  7. {
  8.     public function getDescription(): string
  9.     {
  10.         return 'Add system notification template for test notifications';
  11.     }
  12.     public function up(Schema $schema): void
  13.     {
  14.         // Add system notification template for test notifications
  15.         $this->addSql("INSERT INTO abap_notification_template (id, type, method, subject, content, created_at) VALUES 
  16.             (gen_random_uuid(), 'App\\Notification\\Type\\TestNotification', 'Abap\\NotifierBundle\\Method\\SystemNotificationMethod', 
  17.             'Test System Notification - {{ timestamp|date(\"Y-m-d H:i:s\") }}', 
  18.             '<h1>Test System Notification</h1><p>{{ message }}</p><p>Sent to: {{ recipient }}</p><p>Time: {{ timestamp|date(\"Y-m-d H:i:s\") }}</p>', 
  19.             NOW())");
  20.     }
  21.     public function down(Schema $schema): void
  22.     {
  23.         $this->addSql("DELETE FROM abap_notification_template WHERE type = 'App\\Notification\\Type\\TestNotification' AND method = 'Abap\\NotifierBundle\\Method\\SystemNotificationMethod'");
  24.     }
  25. }