Remove product literal strings in "pht()", part 21
[phabricator.git] / resources / sql / autopatches / 20170811.differential.03.modernxaction.php
blobe84e3ce95bb3e897acbc515facc436d5e8993a2d
1 <?php
3 $map = array(
4 '0' => 'needs-review',
5 '1' => 'needs-revision',
6 '2' => 'accepted',
7 '3' => 'published',
8 '4' => 'abandoned',
9 '5' => 'changes-planned',
12 $table = new DifferentialTransaction();
13 $conn = $table->establishConnection('w');
15 foreach (new LiskMigrationIterator($table) as $xaction) {
16 $type = $xaction->getTransactionType();
18 if (($type != 'differential:status') &&
19 ($type != 'differential.revision.status')) {
20 continue;
23 $old = $xaction->getOldValue();
24 $new = $xaction->getNewValue();
26 $old = idx($map, $old, $old);
27 $new = idx($map, $new, $new);
29 queryfx(
30 $conn,
31 'UPDATE %T SET transactionType = %s, oldValue = %s, newValue = %s
32 WHERE id = %d',
33 $table->getTableName(),
34 'differential.revision.status',
35 json_encode($old),
36 json_encode($new),
37 $xaction->getID());