<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class MatapelajaranRombel 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_matapelajaran' => [
                'type' => 'INT',
                'constraint' => 11,
            ],
            'id_guru' => [
                'type' => 'INT',
                'constraint' => 11,
            ],
            'no_urut' => [
                'type' => 'INT',
                'constraint' => 2,
            ],
            'created_at' => [
                'type' => 'TIMESTAMP',
                'null' => true,
            ],

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

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