migrations/Version20241016174003.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 Version20241016174003 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'fix unexpirable payment';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql('
  18.         UPDATE payment p
  19.         JOIN `order` o ON p.checking_id = o.id
  20.         JOIN `payment_method` pm ON p.payment_method_id = pm.id
  21.         JOIN `payment_method_config` pmc ON pm.payemnt_menthod_config_id = pmc.id
  22.         SET p.state = "expired"
  23.         WHERE p.state = "new"
  24.         AND o.state IN ("failed", "expired")
  25.           AND pmc.code = "nepting-retail-center"
  26.     ');
  27.     }
  28.     public function down(Schema $schema): void {}
  29. }