setSteps([ 'banners' => ['t' => 'Add fields to table banners_pos'], ]); } public function migrate() { if ($this->startStep('banners')) { $this->banners(); } } public function rollback() { } protected function banners() { $table = $this->table(Banners::TABLE_BANNERS_POS); if ($table->hasColumn('width_mobile')) { return; } $this->table(Banners::TABLE_BANNERS_POS) ->addColumn('width_mobile', 'string', ['limit' => 10, 'null' => false, 'default' => '0']) ->addColumn('height_mobile', 'string', ['limit' => 10, 'null' => false, 'default' => '0']) ->update(); $this->db->update(Banners::TABLE_BANNERS_POS, [ 'width_mobile = width', 'height_mobile = height', ]); } }