<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class Task2107012030 extends AbstractMigration
{
    public function up(): void
    {
        $table = $this->table('seguro.propostas_parcelas');
        $singleRow = [
                       'id_usuario_criacao'    => 2530
                     , 'dt_criacao'            => 'now()'
                     , 'id_proposta'           => 524161
                     , 'nr_parcela'            => 2
                     , 'vl_total'              => 6087.11
                     , 'vl_segurado'           => 0.00
                     , 'vl_subvencao_federal'  => 0.00
                     , 'vl_subvencao_estadual' => 6087.11
                     , 'dt_vencimento'         => '2021-07-09'
                     , 'fl_pago'               => 'false'
                     , 'id_endosso'            => 367903
        ];
        $table->insert($singleRow)
              ->saveData();
    }

    public function down(): void
    {
        $delete = $this->getQueryBuilder();
        $delete->delete('seguro.propostas_parcelas')
               ->where([ 'id_proposta' => 524161
                       , 'nr_parcela'  => 2
                      ])
               ->execute();
    }
}
