12 $conn_w = id(new ManiphestTask())->establishConnection('w');
14 echo pht('Migrating tasks to new status constants...')."\n";
15 foreach (new LiskMigrationIterator(new ManiphestTask()) as $task) {
17 echo pht('Migrating %s...', "T{$id}")."\n";
19 $status = $task->getStatus();
20 if (isset($status_map[$status])) {
23 'UPDATE %T SET status = %s WHERE id = %d',
24 $task->getTableName(),
30 echo pht('Done.')."\n";
33 echo pht('Migrating task transactions to new status constants...')."\n";
34 foreach (new LiskMigrationIterator(new ManiphestTransaction()) as $xaction) {
35 $id = $xaction->getID();
36 echo pht('Migrating %d...', $id)."\n";
38 $xn_type = ManiphestTaskStatusTransaction
::TRANSACTIONTYPE
;
39 if ($xaction->getTransactionType() == $xn_type) {
40 $old = $xaction->getOldValue();
41 if ($old !== null && isset($status_map[$old])) {
42 $old = $status_map[$old];
45 $new = $xaction->getNewValue();
46 if (isset($status_map[$new])) {
47 $new = $status_map[$new];
52 'UPDATE %T SET oldValue = %s, newValue = %s WHERE id = %d',
53 $xaction->getTableName(),
59 echo pht('Done.')."\n";
61 $conn_w = id(new PhabricatorSavedQuery())->establishConnection('w');
63 echo pht('Migrating searches to new status constants...')."\n";
64 foreach (new LiskMigrationIterator(new PhabricatorSavedQuery()) as $query) {
65 $id = $query->getID();
66 echo pht('Migrating %d...', $id)."\n";
68 if ($query->getEngineClassName() !== 'ManiphestTaskSearchEngine') {
72 $params = $query->getParameters();
73 $statuses = idx($params, 'statuses', array());
76 foreach ($statuses as $key => $status) {
77 if (isset($status_map[$status])) {
78 $statuses[$key] = $status_map[$status];
84 $params['statuses'] = $statuses;
88 'UPDATE %T SET parameters = %s WHERE id = %d',
89 $query->getTableName(),
95 echo pht('Done.')."\n";