<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class Task2112102013 extends AbstractMigration
{
    public function up(): void
    {
        $this->execute("SELECT manutencao.anular_endosso(684105,160)");
        $this->execute("SELECT manutencao.anular_endosso(684238,160)");
        
        $this->execute("update seguro.propostas_endosso set fl_proposta_vigente = true  where id_proposta = 695818 and id_endosso = 433236");
        $this->execute("update seguro.propostas_endosso set fl_proposta_vigente = false where id_proposta = 555341 and id_endosso = 433236");
        $this->execute("update seguro.propostas_endosso set fl_proposta_vigente = true  where id_proposta = 696271 and id_endosso = 433179");
        $this->execute("update seguro.propostas_endosso set fl_proposta_vigente = false where id_proposta = 607154 and id_endosso = 433179");
    }

    public function down(): void
    {
        $this->execute("SELECT manutencao.anular_endosso(684105,62)");
        $this->execute("SELECT manutencao.anular_endosso(684238,62)");

        $this->execute("update seguro.propostas_endosso set fl_proposta_vigente = true  where id_proposta = 695818 and id_endosso = 433236");
        $this->execute("update seguro.propostas_endosso set fl_proposta_vigente = false where id_proposta = 555341 and id_endosso = 433236");
        $this->execute("update seguro.propostas_endosso set fl_proposta_vigente = true  where id_proposta = 696271 and id_endosso = 433179");
        $this->execute("update seguro.propostas_endosso set fl_proposta_vigente = false where id_proposta = 607154 and id_endosso = 433179");
    }
}
