db->tableExists('doctor_specializations') || ! $this->db->fieldExists('status', 'doctor_specializations')) { return; } $this->db->query("UPDATE `doctor_specializations` SET `status` = '1' WHERE `status` IS NULL OR `status` = '' OR LOWER(`status`) = 'active'"); $this->db->query("UPDATE `doctor_specializations` SET `status` = '0' WHERE LOWER(`status`) = 'inactive'"); $this->forge->modifyColumn('doctor_specializations', [ 'status' => [ 'name' => 'status', 'type' => 'TINYINT', 'constraint' => 1, 'null' => false, 'default' => 1, ], ]); } public function down(): void { if (! $this->db->tableExists('doctor_specializations') || ! $this->db->fieldExists('status', 'doctor_specializations')) { return; } $this->db->query("UPDATE `doctor_specializations` SET `status` = 'active' WHERE `status` = 1"); $this->db->query("UPDATE `doctor_specializations` SET `status` = 'inactive' WHERE `status` = 0"); $this->forge->modifyColumn('doctor_specializations', [ 'status' => [ 'name' => 'status', 'type' => 'VARCHAR', 'constraint' => 20, 'null' => false, 'default' => 'active', ], ]); } }