<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class Task2308071241 extends AbstractMigration
{
    public function up(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 859960');
        if ($row['id']) {
            $this->execute("SELECT seguro.ativa_proposta_status(859960,8)");
            $this->execute("UPDATE seguro.propostas SET nr_apolice = 1000111223286, ds_identificador_seguradora = 9450445 WHERE id = 859960");
        }
    }

    public function down(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 859960');
        if ($row['id']) {
            $this->execute("SELECT seguro.ativa_proposta_status(859960,62)");
            $this->execute("UPDATE seguro.propostas SET nr_apolice = NULL, ds_identificador_seguradora = 9450445 WHERE id = 859960");
        }
    }
}
