Skip to content

Commit e875c81

Browse files
author
epriestley
committed
Remove blameRevision and revertPlan from the DifferentialRevision schema
Summary: These fields use auxiliary storage now. Migrate the data and get rid of the columns in the main table. - This might take a little while to run, although there are <500k rows so probably not too long. - Maybe grab a backup of the table first, if I screwed something up this will delete the data in these fields. Test Plan: - Ran migration locally. - Browsed Differential. - Grepped for "revertPlan" and "blameRevision". Reviewers: jungejason, tuomaspelkonen, aran Reviewed By: jungejason CC: aran, jungejason, epriestley Differential Revision: 832
1 parent 8f3b342 commit e875c81

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
INSERT INTO phabricator_differential.differential_auxiliaryfield
2+
(revisionPHID, name, value, dateCreated, dateModified)
3+
SELECT phid, 'phabricator:blame-revision', blameRevision,
4+
dateCreated, dateModified
5+
FROM phabricator_differential.differential_revision
6+
WHERE blameRevision != '';
7+
8+
ALTER TABLE phabricator_differential.differential_revision
9+
DROP blameRevision;
10+
11+
12+
INSERT INTO phabricator_differential.differential_auxiliaryfield
13+
(revisionPHID, name, value, dateCreated, dateModified)
14+
SELECT phid, 'phabricator:revert-plan', revertPlan,
15+
dateCreated, dateModified
16+
FROM phabricator_differential.differential_revision
17+
WHERE revertPlan != '';
18+
19+
ALTER TABLE phabricator_differential.differential_revision
20+
DROP revertPlan;

src/applications/conduit/method/differential/getrevision/ConduitAPI_differential_getrevision_Method.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ protected function execute(ConduitAPIRequest $request) {
9191
$revision->getStatus()),
9292
'summary' => $revision->getSummary(),
9393
'testPlan' => $revision->getTestPlan(),
94-
'revertPlan' => $revision->getRevertPlan(),
95-
'blameRevision' => $revision->getBlameRevision(),
9694
'lineCount' => $revision->getLineCount(),
9795
'reviewerPHIDs' => $reviewer_phids,
9896
'diffs' => $diff_dicts,

src/applications/differential/editor/revision/DifferentialRevisionEditor.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,6 @@ public function save() {
175175
if ($revision->getAuthorPHID() === null) {
176176
$revision->setAuthorPHID($this->getActorPHID());
177177
}
178-
if ($revision->getRevertPlan() === null) {
179-
$revision->setRevertPlan('');
180-
}
181-
if ($revision->getBlameRevision() === null) {
182-
$revision->setBlameRevision('');
183-
}
184178
if ($revision->getSummary() === null) {
185179
$revision->setSummary('');
186180
}

src/applications/differential/storage/revision/DifferentialRevision.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ class DifferentialRevision extends DifferentialDAO {
2323

2424
protected $summary;
2525
protected $testPlan;
26-
protected $revertPlan;
27-
protected $blameRevision;
2826

2927
protected $phid;
3028
protected $authorPHID;

0 commit comments

Comments
 (0)