1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 23:02:42 +01:00

Clean up repositories with symbols correctly

Summary: We currently try to delete symbols by ID, but the table has a multipart primary key and no `id` column.

Test Plan: Ran query locally; had @JThramer verify fix in his environment.

Reviewers: btrahan

Reviewed By: btrahan

CC: JThramer, aran

Differential Revision: https://secure.phabricator.com/D4626
This commit is contained in:
epriestley 2013-01-24 17:48:41 -08:00
parent 651929dec1
commit 2584af2cb8

View file

@ -34,15 +34,12 @@ final class PhabricatorRepositoryArcanistProject
public function delete() {
$this->openTransaction();
$conn_w = $this->establishConnection('w');
$symbols = id(new PhabricatorRepositorySymbol())->loadAllWhere(
'arcanistProjectID = %d',
$this->getID()
);
foreach ($symbols as $symbol) {
$symbol->delete();
}
queryfx(
$this->establishConnection('w'),
'DELETE FROM %T WHERE arcanistProjectID = %d',
id(new PhabricatorRepositorySymbol())->getTableName(),
$this->getID());
$result = parent::delete();
$this->saveTransaction();