@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
3$map = array(
4 '0' => 'needs-review',
5 '1' => 'needs-revision',
6 '2' => 'accepted',
7 '3' => 'published',
8 '4' => 'abandoned',
9 '5' => 'changes-planned',
10);
11
12$table = new DifferentialTransaction();
13$conn = $table->establishConnection('w');
14
15foreach (new LiskMigrationIterator($table) as $xaction) {
16 $type = $xaction->getTransactionType();
17
18 if (($type != 'differential:status') &&
19 ($type != 'differential.revision.status')) {
20 continue;
21 }
22
23 $old = $xaction->getOldValue();
24 $new = $xaction->getNewValue();
25
26 $old = idx($map, $old, $old);
27 $new = idx($map, $new, $new);
28
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());
38}