Page MenuHomePhabricator

D19091.id45756.diff
No OneTemporary

D19091.id45756.diff

diff --git a/resources/sql/autopatches/20180214.harbor.01.aborted.php b/resources/sql/autopatches/20180214.harbor.01.aborted.php
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20180214.harbor.01.aborted.php
@@ -0,0 +1,27 @@
+<?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',
+ 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());
+}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 2:38 AM (19 h, 36 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6780726
Default Alt Text
D19091.id45756.diff (881 B)

Event Timeline