<?php

namespace App\Database\Migrations\Master;

use CodeIgniter\Database\Migration;

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

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