migrations/Version20250116133436.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. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20250116133436 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Replace "sending" with "pending" in the "status" field of the "event" table and "action" field of the "notification" table, only for rows where "checking_id" is not null.';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql("
  18.             UPDATE event
  19.             SET status = 'pending'
  20.             WHERE status = 'sending' AND checking_id IS NOT NULL
  21.         ");
  22.         $this->addSql("
  23.             UPDATE notification
  24.             SET action = 'pending'
  25.             WHERE action = 'sending' AND order_id IS NOT NULL
  26.         ");
  27.     }
  28. }