1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 01: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() { public function delete() {
$this->openTransaction(); $this->openTransaction();
$conn_w = $this->establishConnection('w');
$symbols = id(new PhabricatorRepositorySymbol())->loadAllWhere( queryfx(
'arcanistProjectID = %d', $this->establishConnection('w'),
$this->getID() 'DELETE FROM %T WHERE arcanistProjectID = %d',
); id(new PhabricatorRepositorySymbol())->getTableName(),
foreach ($symbols as $symbol) { $this->getID());
$symbol->delete();
}
$result = parent::delete(); $result = parent::delete();
$this->saveTransaction(); $this->saveTransaction();