migrations/Version20251113110319.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 Version20251113110319 extends AbstractMigration
  7. {
  8.     public function getDescription(): string
  9.     {
  10.         return 'Update HMAC keys for Popina and Jalia sources on azure staging';
  11.     }
  12.     public function up(Schema $schema): void
  13.     {
  14.         if ('staging' === $_SERVER['APP_SERVER']) {
  15.             $this->addSql("
  16.             UPDATE webhook w
  17.             INNER JOIN source s ON w.source_id = s.id
  18.             SET w.hmac_key = CASE s.name
  19.                 WHEN 'popina' THEN '6860329ace0f4b7a1121b9d1102015cf531678a5'
  20.                 WHEN 'jalia' THEN 'bb4ccfba416339bece4dcfc4d7b67b48b0c06e07'
  21.             END
  22.             WHERE s.name IN ('popina', 'jalia');
  23.         ");
  24.         }
  25.     }
  26. }