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

Undo D6266 (DifferentialComment PHID migration)

Summary:
Ref T2222. My path forward here wasn't very good -- I was thinking I could set `transactionPHID` for the inline comments as I migrated, but it must be unique and an individual DifferentialComment may have more than one inline comment. Dropping the unique requirement just creates more issues for us, not fewer.

So the migration in D6266 isn't actually useful. Undo it -- this can't be a straight revert because some installs may already have upgraded.

Test Plan: Ran new migrations, verified the world ended up back in the same place as before (made comments, viewed reivsions).

Reviewers: btrahan

Reviewed By: btrahan

CC: wez, aran

Maniphest Tasks: T2222

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

+11 -28
+1 -21
resources/sql/patches/20130621.diffcommentphidmig.php
··· 1 1 <?php 2 2 3 - $conn = id(new DifferentialRevision())->establishConnection('r'); 4 - 5 - echo "Assigning transaction PHIDs to DifferentialComments.\n"; 6 - foreach (new LiskRawMigrationIterator($conn, 'differential_comment') as $row) { 7 - $id = $row['id']; 8 - echo "Migrating comment #{$id}...\n"; 9 - if ($row['phid']) { 10 - continue; 11 - } 12 - 13 - queryfx( 14 - $conn, 15 - 'UPDATE %T SET phid = %s WHERE id = %d', 16 - 'differential_comment', 17 - PhabricatorPHID::generateNewPHID( 18 - PhabricatorPHIDConstants::PHID_TYPE_XACT, 19 - PhabricatorPHIDConstants::PHID_TYPE_DREV), 20 - $id); 21 - } 22 - 23 - echo "Done.\n"; 3 + // This patch is unnecessary and was nuked.
+5
resources/sql/patches/20130621.diffcommentunphid.sql
··· 1 + ALTER TABLE {$NAMESPACE}_differential.differential_comment 2 + DROP phid; 3 + 4 + ALTER TABLE {$NAMESPACE}_differential.differential_transaction_comment 5 + ADD legacyCommentID INT UNSIGNED;
-7
src/applications/differential/storage/DifferentialComment.php
··· 20 20 21 21 private $arbitraryDiffForFacebook; 22 22 23 - public function generatePHID() { 24 - return PhabricatorPHID::generateNewPHID( 25 - PhabricatorPHIDConstants::PHID_TYPE_XACT, 26 - PhabricatorPHIDConstants::PHID_TYPE_DREV); 27 - } 28 - 29 23 public function giveFacebookSomeArbitraryDiff(DifferentialDiff $diff) { 30 24 $this->arbitraryDiffForFacebook = $diff; 31 25 return $this; ··· 33 27 34 28 public function getConfiguration() { 35 29 return array( 36 - self::CONFIG_AUX_PHID => true, 37 30 self::CONFIG_SERIALIZATION => array( 38 31 'metadata' => self::SERIALIZATION_JSON, 39 32 ),
+1
src/applications/differential/storage/DifferentialTransactionComment.php
··· 11 11 protected $fixedState; 12 12 protected $hasReplies = 0; 13 13 protected $replyToCommentPHID; 14 + protected $legacyCommentID; 14 15 15 16 public function getApplicationTransactionObject() { 16 17 return new DifferentialTransaction();
+4
src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
··· 1390 1390 'type' => 'php', 1391 1391 'name' => $this->getPatchPath('20130621.diffcommentphidmig.php'), 1392 1392 ), 1393 + '20130621.diffcommentunphid.sql' => array( 1394 + 'type' => 'sql', 1395 + 'name' => $this->getPatchPath('20130621.diffcommentunphid.sql'), 1396 + ), 1393 1397 ); 1394 1398 } 1395 1399 }