@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove three ancient columns from Maniphest tasks: attached, projectPHIDs, ccPHIDs

Summary:
Before edges, we stored some of this stuff directly on tasks.

- `attached` was migrated to edges in Jan 2013.
- `projectPHIDs` was never used, as far as I can tell?
- `ccPHIDs` was migrated away and dropped more than a year ago.

None of these columns are used in modern code (instead, modern code uses edges).

Test Plan: `grep`, browsed around, `bin/storage upgrade`, unit tests.

Reviewers: chad

Reviewed By: chad

Differential Revision: https://secure.phabricator.com/D15216

+6 -70
+2
resources/sql/autopatches/20160208.task.1.sql
··· 1 + ALTER TABLE {$NAMESPACE}_maniphest.maniphest_task 2 + DROP projectPHIDs;
+2
resources/sql/autopatches/20160208.task.2.sql
··· 1 + ALTER TABLE {$NAMESPACE}_maniphest.maniphest_task 2 + DROP attached;
+1 -27
resources/sql/patches/migrate-maniphest-dependencies.php
··· 1 1 <?php 2 2 3 - echo pht('Migrating task dependencies to edges...')."\n"; 4 - $table = new ManiphestTask(); 5 - $table->openTransaction(); 6 - 7 - foreach (new LiskMigrationIterator($table) as $task) { 8 - $id = $task->getID(); 9 - echo pht('Task %d: ', $id); 10 - 11 - $deps = $task->getAttachedPHIDs(ManiphestTaskPHIDType::TYPECONST); 12 - if (!$deps) { 13 - echo "-\n"; 14 - continue; 15 - } 16 - 17 - $editor = new PhabricatorEdgeEditor(); 18 - foreach ($deps as $dep) { 19 - $editor->addEdge( 20 - $task->getPHID(), 21 - ManiphestTaskDependsOnTaskEdgeType::EDGECONST, 22 - $dep); 23 - } 24 - $editor->save(); 25 - echo pht('OKAY')."\n"; 26 - } 27 - 28 - $table->saveTransaction(); 29 - echo pht('Done.')."\n"; 3 + // From 2013-2016, this migration moved dependent tasks to edges.
+1 -26
resources/sql/patches/migrate-maniphest-revisions.php
··· 1 1 <?php 2 2 3 - echo pht('Migrating task revisions to edges...')."\n"; 4 - $table = new ManiphestTask(); 5 - $table->establishConnection('w'); 6 - 7 - foreach (new LiskMigrationIterator($table) as $task) { 8 - $id = $task->getID(); 9 - echo pht('Task %d: ', $id); 10 - 11 - $revs = $task->getAttachedPHIDs(DifferentialRevisionPHIDType::TYPECONST); 12 - if (!$revs) { 13 - echo "-\n"; 14 - continue; 15 - } 16 - 17 - $editor = new PhabricatorEdgeEditor(); 18 - foreach ($revs as $rev) { 19 - $editor->addEdge( 20 - $task->getPHID(), 21 - ManiphestTaskHasRevisionEdgeType::EDGECONST, 22 - $rev); 23 - } 24 - $editor->save(); 25 - echo pht('OKAY')."\n"; 26 - } 27 - 28 - echo pht('Done.')."\n"; 3 + // From 2013-2016, this migration moved revisions attached to tasks to edges.
-17
src/applications/maniphest/storage/ManiphestTask.php
··· 34 34 protected $viewPolicy = PhabricatorPolicies::POLICY_USER; 35 35 protected $editPolicy = PhabricatorPolicies::POLICY_USER; 36 36 37 - protected $projectPHIDs = array(); 38 - 39 37 protected $ownerOrdering; 40 38 protected $spacePHID; 41 39 protected $properties = array(); ··· 44 42 private $groupByProjectPHID = self::ATTACHABLE; 45 43 private $customFields = self::ATTACHABLE; 46 44 private $edgeProjectPHIDs = self::ATTACHABLE; 47 - 48 - // TODO: This field is unused and should eventually be removed. 49 - protected $attached = array(); 50 45 51 46 public static function initializeNewTask(PhabricatorUser $actor) { 52 47 $app = id(new PhabricatorApplicationQuery()) ··· 72 67 return array( 73 68 self::CONFIG_AUX_PHID => true, 74 69 self::CONFIG_SERIALIZATION => array( 75 - 'ccPHIDs' => self::SERIALIZATION_JSON, 76 - 'attached' => self::SERIALIZATION_JSON, 77 - 'projectPHIDs' => self::SERIALIZATION_JSON, 78 70 'properties' => self::SERIALIZATION_JSON, 79 71 ), 80 72 self::CONFIG_COLUMN_SCHEMA => array( ··· 88 80 'ownerOrdering' => 'text64?', 89 81 'originalEmailSource' => 'text255?', 90 82 'subpriority' => 'double', 91 - 92 - // T6203/NULLABILITY 93 - // This should not be nullable. It's going away soon anyway. 94 - 'ccPHIDs' => 'text?', 95 - 96 83 ), 97 84 self::CONFIG_KEY_SCHEMA => array( 98 85 'key_phid' => null, ··· 141 128 return PhabricatorEdgeQuery::loadDestinationPHIDs( 142 129 $this->getPHID(), 143 130 ManiphestTaskDependedOnByTaskEdgeType::EDGECONST); 144 - } 145 - 146 - public function getAttachedPHIDs($type) { 147 - return array_keys(idx($this->attached, $type, array())); 148 131 } 149 132 150 133 public function generatePHID() {