<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class CreatePesertaKelasTable extends Migration
{
    public function up()
    {
        $this->forge->addField([
            'id' => [
                'type'           => 'INT',
                'constraint'     => 11,
                'unsigned'       => true,
                'auto_increment' => true,
            ],
            'id_kelas_kuliah_pddikti' => [
                'type'       => 'VARCHAR',
                'constraint' => '36',
                'null'       => true,
            ],
            'id_mahasiswa_pddikti' => [
                'type'       => 'VARCHAR',
                'constraint' => '36',
                'null'       => true,
            ],
            'nim' => [
                'type'       => 'VARCHAR',
                'constraint' => '50',
                'null'       => true,
            ],
            'nama_mahasiswa' => [
                'type'       => 'VARCHAR',
                'constraint' => '255',
                'null'       => true,
            ],
            'created_at' => [
                'type' => 'DATETIME',
                'null' => true,
            ],
            'updated_at' => [
                'type' => 'DATETIME',
                'null' => true,
            ],
        ]);
        $this->forge->addKey('id', true);
        $this->forge->createTable('peserta_kelas');
    }

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