mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16:52:41 +01:00
d63281cc54
Summary: Depends on D19652. Ref T13197. See PHI851. This migrates the actual `auditStatus` on Commits, and older status transactions. Test Plan: - Ran migrations. - Spot-checked the database for sanity. - Ran some different queries, got unchanged results from before migration. - Reviewed historic audit state transactions, and accepted/raised concern on new audits. All state transactions appeared to generate properly. Reviewers: amckinley Reviewed By: amckinley Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T13197 Differential Revision: https://secure.phabricator.com/D19655
28 lines
563 B
PHP
28 lines
563 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 (new LiskMigrationIterator($table) as $commit) {
|
|
$status = $commit->getAuditStatus();
|
|
|
|
if (!isset($status_map[$status])) {
|
|
continue;
|
|
}
|
|
|
|
queryfx(
|
|
$conn,
|
|
'UPDATE %T SET auditStatus = %s WHERE id = %d',
|
|
$table->getTableName(),
|
|
$status_map[$status],
|
|
$commit->getID());
|
|
}
|