<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241016174003 extends AbstractMigration
{
public function getDescription(): string
{
return 'fix unexpirable payment';
}
public function up(Schema $schema): void
{
$this->addSql('
UPDATE payment p
JOIN `order` o ON p.checking_id = o.id
JOIN `payment_method` pm ON p.payment_method_id = pm.id
JOIN `payment_method_config` pmc ON pm.payemnt_menthod_config_id = pmc.id
SET p.state = "expired"
WHERE p.state = "new"
AND o.state IN ("failed", "expired")
AND pmc.code = "nepting-retail-center"
');
}
public function down(Schema $schema): void {}
}