<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class TaskInc62912 extends AbstractMigration
{
    public function up(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1024955');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_contratos_resseguro');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'id_proposta' => 1024955
                         , 'id_contrato_resseguro' => 5
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 1025060');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_contratos_resseguro');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'id_proposta' => 1025060
                         , 'id_contrato_resseguro' => 5
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
    }

    public function down(): void
    {
        $delete = $this->getQueryBuilder();
        $delete->delete('seguro.propostas_contratos_resseguro')
               ->whereInList('id_proposta', [1024955, 1025060])
               ->execute();
    }
}