mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-28 08:20:57 +01:00
eb3fd2b7f5
Summary: See <https://discourse.phabricator-community.org/t/upgrade-issue-2018-week-7-mid-february/1139>. Test Plan: Used `bin/storage upgrade -f --apply ...` to re-apply the migration. Differential Revision: https://secure.phabricator.com/D19116
28 lines
623 B
PHP
28 lines
623 B
PHP
<?php
|
|
|
|
$table = new HarbormasterBuildable();
|
|
$conn = $table->establishConnection('w');
|
|
|
|
foreach (new LiskMigrationIterator($table) as $buildable) {
|
|
if ($buildable->getBuildableStatus() !== 'building') {
|
|
continue;
|
|
}
|
|
|
|
$aborted = queryfx_one(
|
|
$conn,
|
|
'SELECT * FROM %T WHERE buildablePHID = %s AND buildStatus = %s
|
|
LIMIT 1',
|
|
id(new HarbormasterBuild())->getTableName(),
|
|
$buildable->getPHID(),
|
|
'aborted');
|
|
if (!$aborted) {
|
|
continue;
|
|
}
|
|
|
|
queryfx(
|
|
$conn,
|
|
'UPDATE %T SET buildableStatus = %s WHERE id = %d',
|
|
$table->getTableName(),
|
|
'failed',
|
|
$buildable->getID());
|
|
}
|