<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class TaskSr69236 extends AbstractMigration
{
    public function up(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1099177');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1099177,  8, 1099177, NULL, FALSE, 1001111033302, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2026-07-21 15:00:00' WHERE id_proposta = 1099177 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
    }

    public function down(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1099177');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1099177, 62, 1099177, NULL, FALSE, NULL, NULL)");
            $this->execute("UPDATE seguro.propostas SET nr_apolice = NULL WHERE id   = 1099177");
        }
    }
}
