<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class AddPairingPlanToExamEvents extends Migration
{
    public function up()
    {
        if ($this->db->fieldExists('pairing_plan', 'exam_events')) return;
        $fields = [
            'pairing_plan' => [
                'type' => 'TEXT',
                'null' => true,
            ],
        ];
        $this->forge->addColumn('exam_events', $fields);
    }

    public function down()
    {
        $this->forge->dropColumn('exam_events', 'pairing_plan');
    }
}
