<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class TaskInc47304 extends AbstractMigration
{
    public function up(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 949760');
        if ($row['id']) {
            $builder = $this->getQueryBuilder();
            $builder->update('seguro.propostas_questionario')
                    ->set('ds_resposta', '95989321-71')
                    ->where([ 'id_usuario_criacao' => 4089
                            , 'dt_criacao' => '2024-06-28 11:46:48-03'
                            , 'id_proposta' => 949760
                            , 'id_atributo_rn' => 177
                            ])
                    ->execute();
        }
    }

    public function down(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 949760');
        if ($row['id']) {
            $builder = $this->getQueryBuilder();
            $builder->update('seguro.propostas_questionario')
                    ->set('ds_resposta', NULL)
                    ->where([ 'id_usuario_criacao' => 4089
                            , 'dt_criacao' => '2024-06-28 11:46:48-03'
                            , 'id_proposta' => 949760
                            , 'id_atributo_rn' => 177
                            ])
                    ->execute();
        }
    }
}