<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class RemoveUColonRawAttLog extends Migration
{
    public function up()
    {
        $fields = [
            'ucol1',
            'ucol2',
            'ucol3'
        ];

        $this->forge->dropColumn('raw_att_log', $fields);
    }

    public function down()
    {
        $fields = [
            'ucol1' => [
                'type' => 'VARCHAR',
                'constraint' => 2,
                'null' => true,
                'after' => 'log_time'
            ],
            'ucol2' => [
                'type' => 'VARCHAR',
                'constraint' => 2,
                'null' => true,
                'after' => 'log_type'
            ],
            'ucol3' => [
                'type' => 'VARCHAR',
                'constraint' => 2,
                'null' => true,
                'after' => 'ucol2'
            ],
        ];

        $this->forge->addColumn('raw_att_log', $fields);
    }
}
