addColumn('producer', 'sponsorship_code', Schema::TYPE_STRING); $this->addColumn('producer', 'sponsored_by', Schema::TYPE_INTEGER); $this->addColumn('producer', 'sponsorship_sponsor_reward', Schema::TYPE_BOOLEAN); $this->addColumn('producer', 'sponsorship_godson_reward', Schema::TYPE_BOOLEAN); $producersArray = ProducerRepository::getInstance()->findAll(); foreach($producersArray as $producer) { ProducerBuilder::getInstance()->initSponsorshipCode($producer); $producer->save(); } } /** * {@inheritdoc} */ public function safeDown() { $this->dropColumn('producer', 'sponsorship_code'); $this->dropColumn('producer', 'sponsored_by'); $this->dropColumn('producer', 'sponsorship_sponsor_reward'); $this->dropColumn('producer', 'sponsorship_godson_reward'); } }