mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-04 20:52:43 +01:00
96f9b0917e
Summary: Ref T13216. See PHI959. These two recent migrations can be expressed more efficiently: - When updating commit audit statuses, the field isn't JSON encoded or anything so we can just issue several bulk UPDATEs. - When inserting mail keys, we can batch them in groups of 100. Test Plan: Used `bin/storage upgrade -f --apply phabricator:...` to reapply patches. Saw equivalent behavior and faster runtimes. Reviewers: amckinley Reviewed By: amckinley Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T13216 Differential Revision: https://secure.phabricator.com/D19802
22 lines
442 B
PHP
22 lines
442 B
PHP
<?php
|
|
|
|
$table = new PhabricatorRepositoryCommit();
|
|
$conn = $table->establishConnection('w');
|
|
|
|
$status_map = array(
|
|
0 => 'none',
|
|
1 => 'needs-audit',
|
|
2 => 'concern-raised',
|
|
3 => 'partially-audited',
|
|
4 => 'audited',
|
|
5 => 'needs-verification',
|
|
);
|
|
|
|
foreach ($status_map as $old_status => $new_status) {
|
|
queryfx(
|
|
$conn,
|
|
'UPDATE %R SET auditStatus = %s WHERE auditStatus = %s',
|
|
$table,
|
|
$new_status,
|
|
$old_status);
|
|
}
|