<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class TaskInc44617V2 extends AbstractMigration
{
    public function up(): void
    {
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923537');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923537
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '95695538-62'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923771');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923771
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '92143258-01'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923778');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923778
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '95411147-40'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923790');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923790
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '95362407-96'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923745');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923745
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '95356081-02'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923753');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923753
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '95543973-25'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923645');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923645
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '92543399-75'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923808');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923808
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '95939255-25'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923725');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923725
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '90780060-10'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923713');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923713
                         , 'id_atributo_rn' => 177
                         , 'ds_resposta' => '95471004-14'
            ];
            $table->insert($singleRow)
                  ->saveData();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923611');
        if ($row['id']) {
            $table = $this->table('seguro.propostas_questionario');
            $singleRow = [
                           'id_usuario_criacao' => 2068
                         , 'dt_criacao' => 'NOW()'
                         , 'id_proposta' => 923611
                         , '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 = 923537');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923537
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '95695538-62'
                          ])
                   ->execute();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923771');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923771
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '92143258-01'
                          ])
                   ->execute();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923778');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923778
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '95411147-40'
                          ])
                   ->execute();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923790');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923790
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '95362407-96'
                          ])
                   ->execute();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923745');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923745
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '95356081-02'
                          ])
                   ->execute();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923753');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923753
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '95543973-25'
                          ])
                   ->execute();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923645');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923645
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '92543399-75'
                          ])
                   ->execute();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923808');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923808
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '95939255-25'
                          ])
                   ->execute();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923725');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923725
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '90780060-10'
                          ])
                   ->execute();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923713');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923713
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '95471004-14'
                          ])
                   ->execute();
        }
        $row = $this->fetchRow('SELECT id FROM seguro.propostas WHERE id = 923611');
        if ($row['id']) {
            $delete = $this->getQueryBuilder();
            $delete->delete('seguro.propostas_questionario')
                   ->where([ 'id_usuario_criacao' => 2068
                            , 'id_proposta' => 923611
                            , 'id_atributo_rn' => 177
                            , 'ds_resposta' => '95658207-50'
                          ])
                   ->execute();
        }
    }
}
