<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class TaskInc59838 extends AbstractMigration
{
    public function up(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1044307');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status (1044307,  8, 1044307, NULL, FALSE, 1001111018715, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2025-10-07 17:00:00' WHERE id_proposta = 1044307 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1045015');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status (1045015,  8, 1045015, NULL, FALSE, 1001111018714, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2025-10-07 17:00:00' WHERE id_proposta = 1045015 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
    }
    
    public function down(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1044307');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status (1044307, 62, 1044307, NULL, FALSE, NULL, NULL)");
            $this->execute("UPDATE seguro.propostas SET nr_apolice = NULL where id = 1044307");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1045015');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status (1045015, 62, 1045015, NULL, FALSE, NULL, NULL)");
            $this->execute("UPDATE seguro.propostas SET nr_apolice = NULL where id = 1045015");
        }
    }
}