diff --git a/resources/sql/patches/20130621.diffcommentphidmig.php b/resources/sql/patches/20130621.diffcommentphidmig.php index 92fcb6fd09..6a6baf280f 100644 --- a/resources/sql/patches/20130621.diffcommentphidmig.php +++ b/resources/sql/patches/20130621.diffcommentphidmig.php @@ -1,23 +1,3 @@ establishConnection('r'); - -echo "Assigning transaction PHIDs to DifferentialComments.\n"; -foreach (new LiskRawMigrationIterator($conn, 'differential_comment') as $row) { - $id = $row['id']; - echo "Migrating comment #{$id}...\n"; - if ($row['phid']) { - continue; - } - - queryfx( - $conn, - 'UPDATE %T SET phid = %s WHERE id = %d', - 'differential_comment', - PhabricatorPHID::generateNewPHID( - PhabricatorPHIDConstants::PHID_TYPE_XACT, - PhabricatorPHIDConstants::PHID_TYPE_DREV), - $id); -} - -echo "Done.\n"; +// This patch is unnecessary and was nuked. diff --git a/resources/sql/patches/20130621.diffcommentunphid.sql b/resources/sql/patches/20130621.diffcommentunphid.sql new file mode 100644 index 0000000000..01d57146d6 --- /dev/null +++ b/resources/sql/patches/20130621.diffcommentunphid.sql @@ -0,0 +1,5 @@ +ALTER TABLE {$NAMESPACE}_differential.differential_comment + DROP phid; + +ALTER TABLE {$NAMESPACE}_differential.differential_transaction_comment + ADD legacyCommentID INT UNSIGNED; diff --git a/src/applications/differential/storage/DifferentialComment.php b/src/applications/differential/storage/DifferentialComment.php index 8182f6a883..401b291b51 100644 --- a/src/applications/differential/storage/DifferentialComment.php +++ b/src/applications/differential/storage/DifferentialComment.php @@ -20,12 +20,6 @@ final class DifferentialComment extends DifferentialDAO private $arbitraryDiffForFacebook; - public function generatePHID() { - return PhabricatorPHID::generateNewPHID( - PhabricatorPHIDConstants::PHID_TYPE_XACT, - PhabricatorPHIDConstants::PHID_TYPE_DREV); - } - public function giveFacebookSomeArbitraryDiff(DifferentialDiff $diff) { $this->arbitraryDiffForFacebook = $diff; return $this; @@ -33,7 +27,6 @@ final class DifferentialComment extends DifferentialDAO public function getConfiguration() { return array( - self::CONFIG_AUX_PHID => true, self::CONFIG_SERIALIZATION => array( 'metadata' => self::SERIALIZATION_JSON, ), diff --git a/src/applications/differential/storage/DifferentialTransactionComment.php b/src/applications/differential/storage/DifferentialTransactionComment.php index 0f46665dac..c46d0c4b58 100644 --- a/src/applications/differential/storage/DifferentialTransactionComment.php +++ b/src/applications/differential/storage/DifferentialTransactionComment.php @@ -11,6 +11,7 @@ final class DifferentialTransactionComment protected $fixedState; protected $hasReplies = 0; protected $replyToCommentPHID; + protected $legacyCommentID; public function getApplicationTransactionObject() { return new DifferentialTransaction(); diff --git a/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php b/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php index 32a49918d0..d324ca5226 100644 --- a/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php +++ b/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php @@ -1390,6 +1390,10 @@ final class PhabricatorBuiltinPatchList extends PhabricatorSQLPatchList { 'type' => 'php', 'name' => $this->getPatchPath('20130621.diffcommentphidmig.php'), ), + '20130621.diffcommentunphid.sql' => array( + 'type' => 'sql', + 'name' => $this->getPatchPath('20130621.diffcommentunphid.sql'), + ), ); } }