<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class AddChoicesToJenisJabatan extends Migration
{
    public function up()
    {
        $fields = [
            'jenis_jabatan' => [
                'type' => 'ENUM',
                'constraint' => ['Jabatan Struktural', 'Jabatan Fungsional', 'Jabatan Fungsional Umum/Pelaksana'],
                'null' => true,
                'after' => 'masa_kerja_bulan'
            ],
        ];
        $this->forge->modifyColumn('pegawai', $fields);
    }

    public function down()
    {
        $fields = [
            'jenis_jabatan' => [
                'type' => 'VARCHAR',
                'constraint' => '100',
                'null' => true,
            ],
        ];
        $this->forge->modifyColumn('pegawai', $fields);
    }
}
