if (isset($map[$v])) {
            $new[] = $map[$v];
            $any_change = true;
        } else {
            $new[] = $v;
        }
    }
    if (!$any_change) {
        continue;
    }
    $id = $condition->getID();
    queryfx($conn_w, 'UPDATE %T SET value = %s WHERE id = %d', $table->getTableName(), json_encode($new), $id);
    echo pht('Updated mailing lists in Herald condition %d.', $id) . "\n";
}
$table = new HeraldActionRecord();
$conn_w = $table->establishConnection('w');
foreach (new LiskMigrationIterator($table) as $action) {
    $name = $action->getAction();
    if ($name == 'addcc' || $name == 'remcc') {
        // Okay, we can migrate these.
    } else {
        // This is not an action type which has mailing lists in its targets, so
        // don't try to migrate it.
        continue;
    }
    $value = $action->getTarget();
    if (!is_array($value)) {
        // Only migrate PHID lists.
        continue;
    }
    foreach ($value as $v) {