<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class AddRiwayatFieldsToMahasiswa extends Migration
{
    public function up()
    {
        $this->forge->addColumn('mahasiswa', [
            'tanggal_daftar' => [
                'type' => 'DATE',
                'null' => true,
            ],
            'pembiayaan_awal' => [
                'type'       => 'INT',
                'constraint' => 11,
                'null'       => true,
            ],
            'biaya_masuk' => [
                'type'       => 'INT',
                'constraint' => 11,
                'null'       => true,
            ],
            'asal_pt' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
                'null'       => true,
            ],
            'asal_prodi' => [
                'type'       => 'VARCHAR',
                'constraint' => 255,
                'null'       => true,
            ]
        ]);
    }

    public function down()
    {
        $this->forge->dropColumn('mahasiswa', ['tanggal_daftar', 'pembiayaan_awal', 'biaya_masuk', 'asal_pt', 'asal_prodi']);
    }
}
