<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

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

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

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