<?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 Version20230917113858 extends AbstractMigration
{
public function getDescription(): string
{
return 'Aktualizuje status w Order na finished jeżeli scannedAtStart i scannedAtEnd nie są nullami i status = paid';
}
public function up(Schema $schema): void
{
$this->addSql("UPDATE `order` SET status = 'finished' WHERE scanned_at_start IS NOT NULL AND scanned_at_end IS NOT NULL AND status = 'paid'");
}
public function down(Schema $schema): void
{
$this->addSql("UPDATE `order` SET status = 'paid' WHERE (scanned_at_start IS NULL OR scanned_at_end IS NULL) AND status = 'finished'");
}
}