<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class TaskSr48051 extends AbstractMigration
{
    public function up(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 939208');
        if ($row['id']) {
            $this->execute("SELECT manutencao.atualizar_status (920858, 8, 920858, NULL, FALSE, 1000111236204, NULL)");

            $this->execute("SELECT manutencao.atualizar_status (939208, 62, 939208, NULL, FALSE, NULL, NULL)");
            $this->execute("UPDATE seguro.propostas SET nr_apolice = NULL WHERE id = 939208");
        }
    }

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

            $this->execute("SELECT manutencao.atualizar_status (939208, 8, 939208, NULL, FALSE, 1000111236204, NULL)");
        }
    }
}