<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class AddChapterCpMapToLearningDevices extends Migration
{
    public function up()
    {
        if ($this->db->fieldExists('chapter_cp_map', 'learning_devices')) return;
        $this->forge->addColumn('learning_devices', [
            'chapter_cp_map' => [
                'type' => 'TEXT',
                'null' => true,
                'after' => 'panca_cinta',
            ],
        ]);
    }

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