<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class TaskInc71279 extends AbstractMigration
{
    public function up(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1136101');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1136101,  8, 1136101, NULL, FALSE, 1001111041528, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2026-08-31 15:00:00' WHERE id_proposta = 1136101 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1136108');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1136108,  8, 1136108, NULL, FALSE, 1001111041521, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2026-08-31 15:00:00' WHERE id_proposta = 1136108 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1136163');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1136163,  8, 1136163, NULL, FALSE, 1001111041542, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2026-08-31 15:00:00' WHERE id_proposta = 1136163 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1136187');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1136187,  8, 1136187, NULL, FALSE, 1001111041535, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2026-08-31 15:00:00' WHERE id_proposta = 1136187 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1136202');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1136202,  8, 1136202, NULL, FALSE, 1001111041522, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2026-08-31 15:00:00' WHERE id_proposta = 1136202 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1136213');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1136213,  8, 1136213, NULL, FALSE, 1001111041541, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2026-08-31 15:00:00' WHERE id_proposta = 1136213 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1136232');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1136232,  8, 1136232, NULL, FALSE, 1001111041526, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2026-08-31 15:00:00' WHERE id_proposta = 1136232 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1136241');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1136241,  8, 1136241, NULL, FALSE, 1001111041537, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2026-08-31 15:00:00' WHERE id_proposta = 1136241 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
    }

    public function down(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1136101');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1136101, 62, 1136101, NULL, FALSE, 1001111041528, NULL)");
            $this->execute("UPDATE seguro.propostas SET nr_apolice = NULL WHERE id = 1136101");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1136108');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1136108, 62, 1136108, NULL, FALSE, 1001111041521, NULL)");
            $this->execute("UPDATE seguro.propostas SET nr_apolice = NULL WHERE id = 1136108");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1136163');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1136163, 62, 1136163, NULL, FALSE, 1001111041542, NULL)");
            $this->execute("UPDATE seguro.propostas SET nr_apolice = NULL WHERE id = 1136163");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1136187');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1136187, 62, 1136187, NULL, FALSE, 1001111041535, NULL)");
            $this->execute("UPDATE seguro.propostas SET nr_apolice = NULL WHERE id = 1136187");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1136202');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1136202, 62, 1136202, NULL, FALSE, 1001111041522, NULL)");
            $this->execute("UPDATE seguro.propostas SET nr_apolice = NULL WHERE id = 1136202");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1136213');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1136213, 62, 1136213, NULL, FALSE, 1001111041541, NULL)");
            $this->execute("UPDATE seguro.propostas SET nr_apolice = NULL WHERE id = 1136213");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1136232');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1136232, 62, 1136232, NULL, FALSE, 1001111041526, NULL)");
            $this->execute("UPDATE seguro.propostas SET nr_apolice = NULL WHERE id = 1136232");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1136241');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1136241, 62, 1136241, NULL, FALSE, 1001111041537, NULL)");
            $this->execute("UPDATE seguro.propostas SET nr_apolice = NULL WHERE id = 1136241");
        }
    }
}
