<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class TaskInc59274 extends AbstractMigration
{
    public function up(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1036736');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status (1036736,  8, 1036736, NULL, NULL, 1001111017121, NULL)");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1036770');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status (1036770,  8, 1036770, NULL, NULL, 1001111017122, NULL)");
        }    
    }

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











