1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

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
This commit is contained in:
epriestley 2011-08-18 12:45:59 -07:00
parent 8f3b342287
commit e875c81f6d
4 changed files with 20 additions and 10 deletions

View file

@ -0,0 +1,20 @@
INSERT INTO phabricator_differential.differential_auxiliaryfield
(revisionPHID, name, value, dateCreated, dateModified)
SELECT phid, 'phabricator:blame-revision', blameRevision,
dateCreated, dateModified
FROM phabricator_differential.differential_revision
WHERE blameRevision != '';
ALTER TABLE phabricator_differential.differential_revision
DROP blameRevision;
INSERT INTO phabricator_differential.differential_auxiliaryfield
(revisionPHID, name, value, dateCreated, dateModified)
SELECT phid, 'phabricator:revert-plan', revertPlan,
dateCreated, dateModified
FROM phabricator_differential.differential_revision
WHERE revertPlan != '';
ALTER TABLE phabricator_differential.differential_revision
DROP revertPlan;

View file

@ -91,8 +91,6 @@ class ConduitAPI_differential_getrevision_Method extends ConduitAPIMethod {
$revision->getStatus()),
'summary' => $revision->getSummary(),
'testPlan' => $revision->getTestPlan(),
'revertPlan' => $revision->getRevertPlan(),
'blameRevision' => $revision->getBlameRevision(),
'lineCount' => $revision->getLineCount(),
'reviewerPHIDs' => $reviewer_phids,
'diffs' => $diff_dicts,

View file

@ -175,12 +175,6 @@ class DifferentialRevisionEditor {
if ($revision->getAuthorPHID() === null) {
$revision->setAuthorPHID($this->getActorPHID());
}
if ($revision->getRevertPlan() === null) {
$revision->setRevertPlan('');
}
if ($revision->getBlameRevision() === null) {
$revision->setBlameRevision('');
}
if ($revision->getSummary() === null) {
$revision->setSummary('');
}

View file

@ -23,8 +23,6 @@ class DifferentialRevision extends DifferentialDAO {
protected $summary;
protected $testPlan;
protected $revertPlan;
protected $blameRevision;
protected $phid;
protected $authorPHID;