From c96e17f5ea4230ab26688e818e8f957ceadd7ae1 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 19 Apr 2017 12:01:46 -0700 Subject: [PATCH] Remove "behindTransactionPHID" from ConpherenceParticipant Summary: Pathway to D17685. Nothing reads this field and it has no use or value. Test Plan: - Ran migration. - Grepped for `behindTransactionPHID`. Reviewers: chad Reviewed By: chad Differential Revision: https://secure.phabricator.com/D17729 --- resources/sql/autopatches/20170419.thread.01.behind.sql | 2 ++ src/applications/conpherence/editor/ConpherenceEditor.php | 7 +------ .../conpherence/storage/ConpherenceParticipant.php | 2 -- 3 files changed, 3 insertions(+), 8 deletions(-) create mode 100644 resources/sql/autopatches/20170419.thread.01.behind.sql diff --git a/resources/sql/autopatches/20170419.thread.01.behind.sql b/resources/sql/autopatches/20170419.thread.01.behind.sql new file mode 100644 index 0000000000..08d27337fd --- /dev/null +++ b/resources/sql/autopatches/20170419.thread.01.behind.sql @@ -0,0 +1,2 @@ +ALTER TABLE {$NAMESPACE}_conpherence.conpherence_participant + DROP behindTransactionPHID; diff --git a/src/applications/conpherence/editor/ConpherenceEditor.php b/src/applications/conpherence/editor/ConpherenceEditor.php index c53aab7655..3a870f935b 100644 --- a/src/applications/conpherence/editor/ConpherenceEditor.php +++ b/src/applications/conpherence/editor/ConpherenceEditor.php @@ -168,8 +168,7 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor { // participation data asap to pass policy checks. For existing // ConpherenceThreads, the existing participation is correct // at this stage. Note that later in applyCustomExternalTransaction - // this participation data will be updated, particularly the - // behindTransactionPHID which is just a generated dummy for now. + // this participation data will be updated. $participants = array(); $phids = $this->getPHIDTransactionNewValue($xaction, array()); foreach ($phids as $phid) { @@ -186,7 +185,6 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor { ->setParticipantPHID($phid) ->setParticipationStatus($status) ->setDateTouched(time()) - ->setBehindTransactionPHID($xaction->generatePHID()) ->setSeenMessageCount($message_count) ->save(); $object->attachParticipants($participants); @@ -257,7 +255,6 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor { ->setParticipantPHID($phid) ->setParticipationStatus($status) ->setDateTouched(time()) - ->setBehindTransactionPHID($xaction->getPHID()) ->setSeenMessageCount($message_count) ->save(); } @@ -290,7 +287,6 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor { foreach ($participants as $phid => $participant) { if ($phid != $user->getPHID()) { if ($participant->getParticipationStatus() != $behind) { - $participant->setBehindTransactionPHID($xaction_phid); $participant->setSeenMessageCount( $object->getMessageCount() - $message_count); } @@ -298,7 +294,6 @@ final class ConpherenceEditor extends PhabricatorApplicationTransactionEditor { $participant->setDateTouched($time); } else { $participant->setSeenMessageCount($object->getMessageCount()); - $participant->setBehindTransactionPHID($xaction_phid); $participant->setParticipationStatus($up_to_date); $participant->setDateTouched($time); } diff --git a/src/applications/conpherence/storage/ConpherenceParticipant.php b/src/applications/conpherence/storage/ConpherenceParticipant.php index 32c3fb38e1..ddce989e3f 100644 --- a/src/applications/conpherence/storage/ConpherenceParticipant.php +++ b/src/applications/conpherence/storage/ConpherenceParticipant.php @@ -5,7 +5,6 @@ final class ConpherenceParticipant extends ConpherenceDAO { protected $participantPHID; protected $conpherencePHID; protected $participationStatus; - protected $behindTransactionPHID; protected $seenMessageCount; protected $dateTouched; protected $settings = array(); @@ -44,7 +43,6 @@ final class ConpherenceParticipant extends ConpherenceDAO { ConpherenceTransaction $xaction) { if (!$this->isUpToDate($conpherence)) { $this->setParticipationStatus(ConpherenceParticipationStatus::UP_TO_DATE); - $this->setBehindTransactionPHID($xaction->getPHID()); $this->setSeenMessageCount($conpherence->getMessageCount()); $this->save();