@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.

Remove on-object mailkeys from Phriction

Summary: Depends on D19619. Ref T13065. Ref T13077. Migrate Phriction mail keys to the new infrastructure and drop the column.

Test Plan: Ran migrations, spot-checked the database.

Reviewers: amckinley

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13077, T13065

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

+31 -12
+26
resources/sql/autopatches/20180829.phriction.01.mailkey.php
··· 1 + <?php 2 + 3 + $document_table = new PhrictionDocument(); 4 + $document_conn = $document_table->establishConnection('w'); 5 + $document_name = $document_table->getTableName(); 6 + 7 + $properties_table = new PhabricatorMetaMTAMailProperties(); 8 + $conn = $properties_table->establishConnection('w'); 9 + 10 + $iterator = new LiskRawMigrationIterator($document_conn, $document_name); 11 + foreach ($iterator as $row) { 12 + queryfx( 13 + $conn, 14 + 'INSERT IGNORE INTO %T 15 + (objectPHID, mailProperties, dateCreated, dateModified) 16 + VALUES 17 + (%s, %s, %d, %d)', 18 + $properties_table->getTableName(), 19 + $row['phid'], 20 + phutil_json_encode( 21 + array( 22 + 'mailKey' => $row['mailKey'], 23 + )), 24 + PhabricatorTime::getNow(), 25 + PhabricatorTime::getNow()); 26 + }
+2
resources/sql/autopatches/20180829.phriction.02.rmkey.sql
··· 1 + ALTER TABLE {$NAMESPACE}_phriction.phriction_document 2 + DROP mailKey;
+3 -12
src/applications/phriction/storage/PhrictionDocument.php
··· 19 19 protected $depth; 20 20 protected $contentPHID; 21 21 protected $status; 22 - protected $mailKey; 23 22 protected $viewPolicy; 24 23 protected $editPolicy; 25 24 protected $spacePHID; ··· 36 35 'slug' => 'sort128', 37 36 'depth' => 'uint32', 38 37 'status' => 'text32', 39 - 'mailKey' => 'bytes20', 40 38 'editedEpoch' => 'epoch', 41 39 ), 42 40 self::CONFIG_KEY_SCHEMA => array( ··· 93 91 $document->setEditedEpoch(PhabricatorTime::getNow()); 94 92 95 93 return $document; 96 - } 97 - 98 - public function save() { 99 - if (!$this->getMailKey()) { 100 - $this->setMailKey(Filesystem::readRandomCharacters(20)); 101 - } 102 - return parent::save(); 103 94 } 104 95 105 96 public static function getSlugURI($slug, $type = 'document') { ··· 329 320 /* -( PhabricatorPolicyCodexInterface )------------------------------------ */ 330 321 331 322 332 - public function newPolicyCodex() { 333 - return new PhrictionDocumentPolicyCodex(); 334 - } 323 + public function newPolicyCodex() { 324 + return new PhrictionDocumentPolicyCodex(); 325 + } 335 326 336 327 337 328 }