<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class TaskSr57810 extends AbstractMigration
{
    public function up(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1020915');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status (1020915,  8, 1020915, NULL, FALSE, 1001111007596, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2025-06-27 15:00:00' WHERE id_proposta = 1020915 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
    }
    
    public function down(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1020915');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status (1020915, 62, 1020915, NULL, FALSE, NULL, NULL)");
            $this->execute("UPDATE seguro.propostas SET nr_apolice = NULL where id = 1020915");
        }
    }
}
