<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

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

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