<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class Task2201182055 extends AbstractMigration
{
    public function up(): void
    {
        $delete = $this->getQueryBuilder();
        $delete->delete('seguro.propostas_status')
               ->where(['id_proposta' => 541530])
               ->where(['id' => 1279041])
               ->execute();

        $builder = $this->getQueryBuilder();
        $builder->update('seguro.propostas')
                ->set('nr_apolice', 1000111165465)
                ->where(['nr_apolice' => 1000111165464])
                ->where(['id' => 541530])
                ->execute();
    }

    public function down(): void
    {
        $builder = $this->getQueryBuilder();
        $builder->update('seguro.propostas')
                ->set('nr_apolice', 1000111165465)
                ->where(['nr_apolice' => 1000111165464])
                ->where(['id' => 541530])
                ->execute();

        $table = $this->table('seguro.propostas_status');
        $singleRow = [
                       'id_usuario_criacao' => 1033
                     , 'dt_criacao' => '2021-08-26 12:57:37-03'
                     , 'fl_ativo' => TRUE
                     , 'fl_del' => FALSE
                     , 'id_proposta' => 541530
                     , 'id_status' => 8
                     , 'id' => 1279041
        ];
        $table->insert($singleRow)
              ->saveData();
    }
}
