ALTER TABLE `table_name` ADD `my_column` SET('optionOne','optionTwo') NULL DEFAULT NULL COMMENT 'Comment for Columm';
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class YourMigration extends Migration
{
public function up()
{
//
$this->forge->addField([
'id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
'auto_increment' => true,
],
// Note lock here
"my_column SET('optionOne','optionTwo') NULL DEFAULT NULL COMMENT 'Comment for Columm'",
]);
$this->forge->addKey('id', true);
$this->forge->createTable('table_name');
}
public function down()
{
//drop 'alert_messages' table
$this->forge->dropTable('table_name');
}
}