<?php

namespace App\Database\Migrations\Master;

use CodeIgniter\Database\Migration;

class Jurusan extends Migration
{
    public function up()
    {
        $fields = [
            'id'   => ['type' => 'int', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true],
            'kode' => ['type' => 'char', 'constraint' => 30],
            'nama' => ['type' => 'varchar', 'constraint' => 255],
        ];
        $this->forge->addField($fields);
        $this->forge->addKey('id', true);
        $this->forge->addUniqueKey('kode');
        $this->forge->createTable('m_jurusan', true);
    }

    public function down()
    {
        $this->forge->dropTable('m_jurusan', true);
    }
}
