Viewing File: /home/ubuntu/code_review/phabricator/resources/sql/autopatches/20150725.slowvote.mailkey.2.php

<?php

$table = new PhabricatorSlowvotePoll();
$conn_w = $table->establishConnection('w');
$iterator = new LiskMigrationIterator($table);
foreach ($iterator as $slowvote) {
  $id = $slowvote->getID();

  echo pht('Adding mail key for Slowvote %d...', $id);
  echo "\n";

  queryfx(
    $conn_w,
    'UPDATE %T SET mailKey = %s WHERE id = %d',
    $table->getTableName(),
    Filesystem::readRandomCharacters(20),
    $id);
}
Back to Directory File Manager