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

Permanently destroy Almanac properties with the destruction engine

Summary: As suggested in D14461.

Test Plan: Used `./bin/remove destroy` on an Almanac service with properties attached, saw entries removed from the `phabricator_almanac.almanac_property` table.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14490
This commit is contained in:
Joshua Spence 2015-11-15 20:58:50 +00:00 committed by joshuaspence
parent 67b6c532bc
commit 1a84a2fe4b

View file

@ -92,6 +92,10 @@ final class PhabricatorDestructionEngine extends Phobject {
$token->delete(); $token->delete();
} }
} }
if ($object instanceof AlmanacPropertyInterface) {
$this->destroyAlmanacProperties($object_phid);
}
} }
private function destroyEdges($src_phid) { private function destroyEdges($src_phid) {
@ -148,4 +152,15 @@ final class PhabricatorDestructionEngine extends Phobject {
$object_phid); $object_phid);
} }
private function destroyAlmanacProperties($object_phid) {
$table = new AlmanacProperty();
$conn_w = $table->establishConnection('w');
queryfx(
$conn_w,
'DELETE FROM %T WHERE objectPHID = %s',
$table->getTableName(),
$object_phid);
}
} }