<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class TaskInc47631 extends AbstractMigration
{
    public function up(): void
    {
        $row = $this->fetchRow('SELECT id FROM sinistro.avisos WHERE id = 144532');
        if ($row['id']) {
            $builder = $this->getQueryBuilder();
            $builder->update('sinistro.avisos')
                    ->set('id_status', 168)
                    ->where(['id' => 144532])
                    ->execute();
        }
    }

    public function down(): void
    {
        $row = $this->fetchRow('SELECT id FROM sinistro.avisos WHERE id = 144532');
        if ($row['id']) {
            $builder = $this->getQueryBuilder();
            $builder->update('sinistro.avisos')
                    ->set('id_status', 28)
                    ->where(['id' => 144532])
                    ->execute();
        }
    }
}
