1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-29 00:40:57 +01:00

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
This commit is contained in:
epriestley 2013-06-24 11:00:35 -07:00
parent 705dfa25e6
commit 3124838d65
5 changed files with 11 additions and 28 deletions

View file

@ -1,23 +1,3 @@
<?php
$conn = id(new DifferentialRevision())->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.

View file

@ -0,0 +1,5 @@
ALTER TABLE {$NAMESPACE}_differential.differential_comment
DROP phid;
ALTER TABLE {$NAMESPACE}_differential.differential_transaction_comment
ADD legacyCommentID INT UNSIGNED;

View file

@ -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,
),

View file

@ -11,6 +11,7 @@ final class DifferentialTransactionComment
protected $fixedState;
protected $hasReplies = 0;
protected $replyToCommentPHID;
protected $legacyCommentID;
public function getApplicationTransactionObject() {
return new DifferentialTransaction();

View file

@ -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'),
),
);
}
}