tableExists('calendar_events')) { return; } $cols = []; try { $cols = $db->getFieldNames('calendar_events'); } catch (\Throwable $e) { $cols = []; } if (!in_array('no_school', $cols, true)) { $this->forge->addColumn('calendar_events', [ 'no_school' => [ 'type' => 'TINYINT', 'constraint' => 1, 'null' => false, 'default' => 0, 'after' => 'notify_teacher', ], ]); } } public function down() { if (! $this->db->tableExists('calendar_events')) { return; } try { $this->forge->dropColumn('calendar_events', 'no_school'); } catch (\Throwable $e) { // ignore } } }