@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3echo pht('Populating Questions with mail keys...')."\n";
4$table = new PonderQuestion();
5$table->openTransaction();
6
7foreach (new LiskMigrationIterator($table) as $question) {
8 $id = $question->getID();
9
10 echo pht('Question %d: ', $id);
11 if (!$question->getMailKey()) {
12 queryfx(
13 $question->establishConnection('w'),
14 'UPDATE %T SET mailKey = %s WHERE id = %d',
15 $question->getTableName(),
16 Filesystem::readRandomCharacters(20),
17 $id);
18 echo pht('Generated Key')."\n";
19 } else {
20 echo "-\n";
21 }
22}
23
24$table->saveTransaction();
25echo pht('Done.')."\n";