<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class Tingkat extends Migration
{
    public function up()
    {
        $this->forge->addField([
            'id' => [
                'type' => 'INT',
                'constraint' => 11,
                'unsigned' => true,
                'auto_increment' => true,
            ],
            'tingkat' => [
                'type' => 'VARCHAR',
                'constraint' => 5,
            ],
            'status' => [
                'type'       => 'ENUM',
                'constraint' => ['aktif', 'tidak'],
                'default'    => 'aktif',
            ],
            'created_at' => [
                'type' => 'TIMESTAMP',
                'null' => true,
            ],

        ]);
        $this->forge->addKey('id', true);
        $this->forge->createTable('tingkat');
    }

    public function down()
    {
        $this->forge->dropTable('tingkat');
    }
}
