<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class TaskInc69451 extends AbstractMigration
{
    public function up(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1121450');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1121450,  8, 1121450, NULL, FALSE, 1001111035859, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2026-07-30 12:00:00' WHERE id_proposta = 1121450 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1117437');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1117437,  8, 1117437, NULL, FALSE, 1001111033936, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2026-07-21 12:00:00' WHERE id_proposta = 1117437 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1117454');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1117454,  8, 1117454, NULL, FALSE, 1001111033926, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2026-07-21 12:00:00' WHERE id_proposta = 1117454 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1108042');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1108042,  8, 1108042, NULL, FALSE, 1001111034581, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2026-07-29 12:00:00' WHERE id_proposta = 1108042 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1123520');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1123520,  8, 1123520, NULL, FALSE, 1001111036466, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2026-07-31 12:00:00' WHERE id_proposta = 1123520 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1123680');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status ( 1123680,  8, 1123680, NULL, FALSE, 1001111036467, NULL)");
            $this->execute("UPDATE seguro.propostas_status SET dt_criacao = '2026-07-31 12:00:00' WHERE id_proposta = 1123680 AND id_usuario_criacao = 2068 AND id_status = 8");
        }
    }

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