1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00
phorge-phorge/resources/sql/patches/072.blamerevert.sql
epriestley e875c81f6d 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
2011-09-04 16:19:12 -07:00

20 lines
740 B
SQL

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;