<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class RequireAdministratorUserRole extends Migration
{
    public function up()
    {
        $this->forge->modifyColumn('user', [
            'role' => [
                'type'       => 'VARCHAR',
                'constraint' => 30,
                'default'    => 'administrator',
                'null'       => false,
            ],
        ]);
    }

    public function down()
    {
        $this->forge->modifyColumn('user', [
            'role' => [
                'type'       => 'VARCHAR',
                'constraint' => 30,
                'default'    => 'administrator',
                'null'       => true,
            ],
        ]);
    }
}
