db->tableExists('school_years')) { return; } foreach (['registration_fee', 'mandatory_fees'] as $column) { if ($this->db->fieldExists($column, 'school_years')) { $this->forge->dropColumn('school_years', $column); } } } public function down() { if (! $this->db->tableExists('school_years')) { return; } if (! $this->db->fieldExists('registration_fee', 'school_years')) { $this->forge->addColumn('school_years', [ 'registration_fee' => [ 'type' => 'DECIMAL', 'constraint' => '10,2', 'default' => 0, 'after' => 'adult_student_registration_enabled', ], ]); } if (! $this->db->fieldExists('mandatory_fees', 'school_years')) { $this->forge->addColumn('school_years', [ 'mandatory_fees' => [ 'type' => 'DECIMAL', 'constraint' => '10,2', 'default' => 0, 'after' => 'tuition_due_at_registration', ], ]); } } }