<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class Task2203281132 extends AbstractMigration
{
    public function up(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 735345');
        if ($row['id']) {
            $this->execute("SELECT manutencao.anular_endosso(735345,212)");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 737843');
        if ($row['id']) {
            $this->execute("SELECT manutencao.anular_endosso(737843,212)");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 740702');
        if ($row['id']) {
            $this->execute("SELECT manutencao.anular_endosso(740702,212)");
        }
    }

    public function down(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 735345');
        if ($row['id']) {
            $this->execute("SELECT manutencao.anular_endosso(735345,62)");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 737843');
        if ($row['id']) {
            $this->execute("SELECT manutencao.anular_endosso(737843,62)");
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 740702');
        if ($row['id']) {
            $this->execute("SELECT manutencao.anular_endosso(740702,62)");
        }
    }
}
