<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class TaskInc54333 extends AbstractMigration
{
    public function up(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 926353');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_status')
                   ->where(['id_proposta' => 926353, 'id' => 1676671, 'id_status' => 8])
                   ->execute();
        }
    }

    public function down(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 926353');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_status');
            $singleRow = [
                           'id_usuario_criacao' => 1033
                         , 'dt_criacao'         => '2024-06-14 08:19:46-03'
                         , 'id_proposta'        => 926353
                         , 'id_status'          => 8
                         , 'ds_observacao'      => NULL
                         , 'id'                 => 1676671
                         ];
            $table->insert($singleRow)
                  ->saveData();
        }
    }
}
