<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class TaskInc44617 extends AbstractMigration
{
    public function up(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923597');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923597
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '95998343-78'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923510');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923510
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '91029237-47'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923556');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923556
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '95697654-52'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923528');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923528
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '90655104-70'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923660');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923660
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '95763431-13'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923692');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923692
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '95763431-13'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923573');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923573
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '95567298-48'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923765');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923765
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '95913893-16'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
    }

    public function down(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923597');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923597
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '95998343-78'
                          ])
                   ->execute();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923510');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923510
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '91029237-47'
                          ])
                   ->execute();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923556');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923556
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '95697654-52'
                          ])
                   ->execute();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923528');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923528
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '90655104-70'
                          ])
                   ->execute();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923660');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923660
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '95763431-13'
                          ])
                   ->execute();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923692');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923692
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '95763431-13'
                          ])
                   ->execute();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923573');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923573
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '95567298-48'
                          ])
                   ->execute();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923765');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923765
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '95913893-16'
                          ])
                   ->execute();
        }
    }
}