@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

MetaMTA - save actorPHID as its own column

Summary: Ref T5791. This should make performance snappy wrt policy checks in some future diff where the Query is updated and in use somewhere in the application.

Test Plan: ran `./bin/storage upgrade`. commented on a task and saw actorPHID populated correctly in underlying MetaMTAMail object database entry

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5791

Differential Revision: https://secure.phabricator.com/D13396

+41
+2
resources/sql/autopatches/20150622.metamta.4.actor-phid-col.sql
··· 1 + ALTER TABLE {$NAMESPACE}_metamta.metamta_mail 2 + ADD actorPHID VARBINARY(64) AFTER phid;
+27
resources/sql/autopatches/20150622.metamta.5.actor-phid-mig.php
··· 1 + <?php 2 + 3 + $table = new PhabricatorMetaMTAMail(); 4 + $conn_w = $table->establishConnection('w'); 5 + 6 + echo pht('Assigning actorPHIDs to mails...')."\n"; 7 + foreach (new LiskMigrationIterator($table) as $mail) { 8 + $id = $mail->getID(); 9 + 10 + echo pht('Updating mail %d...', $id)."\n"; 11 + if ($mail->getActorPHID()) { 12 + continue; 13 + } 14 + 15 + $actor_phid = $mail->getFrom(); 16 + if ($actor_phid === null) { 17 + continue; 18 + } 19 + 20 + queryfx( 21 + $conn_w, 22 + 'UPDATE %T SET actorPHID = %s WHERE id = %d', 23 + $table->getTableName(), 24 + $actor_phid, 25 + $id); 26 + } 27 + echo pht('Done.')."\n";
+2
resources/sql/autopatches/20150622.metamta.6.actor-phid-key.sql
··· 1 + ALTER TABLE {$NAMESPACE}_metamta.metamta_mail 2 + ADD KEY `key_actorPHID` (actorPHID);
+10
src/applications/metamta/storage/PhabricatorMetaMTAMail.php
··· 14 14 15 15 const RETRY_DELAY = 5; 16 16 17 + protected $actorPHID; 17 18 protected $parameters; 18 19 protected $status; 19 20 protected $message; ··· 36 37 'parameters' => self::SERIALIZATION_JSON, 37 38 ), 38 39 self::CONFIG_COLUMN_SCHEMA => array( 40 + 'actorPHID' => 'phid?', 39 41 'status' => 'text32', 40 42 'relatedPHID' => 'phid?', 41 43 ··· 46 48 self::CONFIG_KEY_SCHEMA => array( 47 49 'status' => array( 48 50 'columns' => array('status'), 51 + ), 52 + 'key_actorPHID' => array( 53 + 'columns' => array('actorPHID'), 49 54 ), 50 55 'relatedPHID' => array( 51 56 'columns' => array('relatedPHID'), ··· 219 224 220 225 public function setFrom($from) { 221 226 $this->setParam('from', $from); 227 + $this->setActorPHID($from); 222 228 return $this; 229 + } 230 + 231 + public function getFrom() { 232 + return $this->getParam('from'); 223 233 } 224 234 225 235 public function setRawFrom($raw_email, $raw_name) {