<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class AddCodeToSubjectsTable extends Migration
{
    public function up()
    {
        $this->forge->addColumn('subjects', [
            'code' => [
                'type'       => 'VARCHAR',
                'constraint' => 50,
                'null'       => true,
                'after'      => 'name',
            ],
        ]);
    }

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