Page MenuHomePhabricator

D13011.id31378.diff
No OneTemporary

D13011.id31378.diff

diff --git a/resources/sql/autopatches/20150503.repositorysymbols.2.php b/resources/sql/autopatches/20150503.repositorysymbols.2.php
--- a/resources/sql/autopatches/20150503.repositorysymbols.2.php
+++ b/resources/sql/autopatches/20150503.repositorysymbols.2.php
@@ -1,26 +1,29 @@
<?php
-$projects = id(new PhabricatorRepositoryArcanistProjectQuery())
- ->setViewer(PhabricatorUser::getOmnipotentUser())
- ->needRepositories(true)
- ->execute();
-
$table = new PhabricatorRepositorySymbol();
$conn_w = $table->establishConnection('w');
+$projects = queryfx_all(
+ $conn_w,
+ 'SELECT * FROM %T',
+ 'repository_arcanistproject');
+
foreach ($projects as $project) {
- $repo = $project->getRepository();
+ $repo = id(new PhabricatorRepositoryQuery())
+ ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->withIDs(array($project['repository']))
+ ->executeOne();
if (!$repo) {
continue;
}
- echo pht("Migrating symbols for '%s' project...\n", $project->getName());
+ echo pht("Migrating symbols for '%s' project...\n", $project['name']);
queryfx(
$conn_w,
'UPDATE %T SET repositoryPHID = %s WHERE arcanistProjectID = %d',
$table->getTableName(),
$repo->getPHID(),
- $project->getID());
+ $project['id']);
}
diff --git a/resources/sql/patches/131.migraterevisionquery.php b/resources/sql/patches/131.migraterevisionquery.php
--- a/resources/sql/patches/131.migraterevisionquery.php
+++ b/resources/sql/patches/131.migraterevisionquery.php
@@ -18,14 +18,18 @@
}
$branch_name = $diff->getBranch();
- $arc_project_phid = $diff->getArcanistProjectPHID();
+ $arc_project_phid = queryfx(
+ $conn_w,
+ 'SELECT arcanistProjectPHID FROM %T WHERE id = %d',
+ id(new DifferentialDiff())->getTableName(),
+ $diff->getID());
queryfx(
$conn_w,
'UPDATE %T SET branchName = %s, arcanistProjectPHID = %s WHERE id = %d',
$table->getTableName(),
$branch_name,
- $arc_project_phid,
+ $arc_project_phid['arcanistProjectPHID'],
$revision->getID());
}
} while (count($revisions) == 1000);

File Metadata

Mime Type
text/plain
Expires
Mar 16 2025, 4:33 PM (5 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7707353
Default Alt Text
D13011.id31378.diff (2 KB)

Event Timeline