From 8f8c61be315a36887c43d468ca2764a58492e2b3 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 12 Sep 2013 13:04:09 -0700 Subject: [PATCH] Remove legacy "touched" table and indexing Summary: Noticed this in the schema. "Touches" were an idea that never really got off the ground, as we built out more/better notification channels instead. Essentially, they recorded any object you'd ever interacted with. Maybe this will be useful some day, but for now it does nothing and can't be interacted with. Nuke it. Test Plan: `grep`, loaded Maniphest. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D6953 --- .../sql/patches/20130912.maniphest.1.touch.sql | 1 + .../search/DifferentialSearchIndexer.php | 13 ------------- .../maniphest/search/ManiphestSearchIndexer.php | 12 ------------ .../constants/PhabricatorSearchRelationship.php | 1 - .../storage/patch/PhabricatorBuiltinPatchList.php | 4 ++++ 5 files changed, 5 insertions(+), 26 deletions(-) create mode 100644 resources/sql/patches/20130912.maniphest.1.touch.sql diff --git a/resources/sql/patches/20130912.maniphest.1.touch.sql b/resources/sql/patches/20130912.maniphest.1.touch.sql new file mode 100644 index 0000000000..a44802246c --- /dev/null +++ b/resources/sql/patches/20130912.maniphest.1.touch.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS {$NAMESPACE}_maniphest.maniphest_touch; diff --git a/src/applications/differential/search/DifferentialSearchIndexer.php b/src/applications/differential/search/DifferentialSearchIndexer.php index 36403e1165..01de4dc2e9 100644 --- a/src/applications/differential/search/DifferentialSearchIndexer.php +++ b/src/applications/differential/search/DifferentialSearchIndexer.php @@ -62,25 +62,12 @@ final class DifferentialSearchIndexer ->withNotDraft(true) ->execute(); - $touches = array(); - foreach (array_merge($comments, $inlines) as $comment) { if (strlen($comment->getContent())) { $doc->addField( PhabricatorSearchField::FIELD_COMMENT, $comment->getContent()); } - - $author = $comment->getAuthorPHID(); - $touches[$author] = $comment->getDateCreated(); - } - - foreach ($touches as $touch => $time) { - $doc->addRelationship( - PhabricatorSearchRelationship::RELATIONSHIP_TOUCH, - $touch, - PhabricatorPeoplePHIDTypeUser::TYPECONST, - $time); } $rev->loadRelationships(); diff --git a/src/applications/maniphest/search/ManiphestSearchIndexer.php b/src/applications/maniphest/search/ManiphestSearchIndexer.php index fdeb7e0546..e861206c80 100644 --- a/src/applications/maniphest/search/ManiphestSearchIndexer.php +++ b/src/applications/maniphest/search/ManiphestSearchIndexer.php @@ -43,7 +43,6 @@ final class ManiphestSearchIndexer $task->getID()); $current_ccs = $task->getCCPHIDs(); - $touches = array(); $owner = null; $ccs = array(); foreach ($transactions as $transaction) { @@ -55,9 +54,6 @@ final class ManiphestSearchIndexer $author = $transaction->getAuthorPHID(); - // Record the most recent time they touched this object. - $touches[$author] = $transaction->getDateCreated(); - switch ($transaction->getTransactionType()) { case ManiphestTransactionType::TYPE_OWNER: $owner = $transaction; @@ -100,14 +96,6 @@ final class ManiphestSearchIndexer : $task->getDateCreated()); } - foreach ($touches as $touch => $time) { - $doc->addRelationship( - PhabricatorSearchRelationship::RELATIONSHIP_TOUCH, - $touch, - PhabricatorPeoplePHIDTypeUser::TYPECONST, - $time); - } - // We need to load handles here since non-users may subscribe (mailing // lists, e.g.) $handles = id(new PhabricatorHandleQuery()) diff --git a/src/applications/search/constants/PhabricatorSearchRelationship.php b/src/applications/search/constants/PhabricatorSearchRelationship.php index 92f2c9129b..246e39fdce 100644 --- a/src/applications/search/constants/PhabricatorSearchRelationship.php +++ b/src/applications/search/constants/PhabricatorSearchRelationship.php @@ -14,6 +14,5 @@ final class PhabricatorSearchRelationship { const RELATIONSHIP_REPOSITORY = 'repo'; const RELATIONSHIP_OPEN = 'open'; - const RELATIONSHIP_TOUCH = 'poke'; } diff --git a/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php b/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php index 9d81e7daf2..e0967875e5 100644 --- a/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php +++ b/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php @@ -1572,6 +1572,10 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList { 'name' => $this->getPatchPath('20130820.file-mailkey-populate.php'), ), + '20130912.maniphest.1.touch.sql' => array( + 'type' => 'sql', + 'name' => $this->getPatchPath('20130912.maniphest.1.touch.sql'), + ), ); } }