establishConnection('w'); foreach (new LiskMigrationIterator($table) as $row) { if ($row->getPHID()) { continue; } $new_phid = $row->generatePHID(); queryfx( $conn, 'UPDATE %T SET phid = %s WHERE id = %d', $table->getTableName(), $new_phid, $row->getID()); }