<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

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

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