migration = $factory; } /** * @param Updater $updater * * @return Migration[] */ public function getMigrations(Updater $updater) { $table = Common::prefixTable('report'); $invalidCount = Db::fetchOne( "SELECT COUNT(*) FROM $table WHERE reports = ? OR parameters = ?", ['Array', 'Array'] ); if (0 === (int) $invalidCount) { return []; } return [ $this->migration->db->sql("DELETE FROM " . $table . " WHERE reports = 'Array' OR parameters = 'Array'"), ]; } public function doUpdate(Updater $updater) { $updater->executeMigrations(__FILE__, $this->getMigrations($updater)); } }