@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.

Generate expected schemata for Dashboards and Conpherence

Summary:
Ref T1191.

- Add edge schemata generation.
- Hit a couple of mostly-minor issues (T6128, T6129, T6130).

Test Plan: Viewed schema in web UI.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T1191

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

+107 -1
+4
src/__phutil_library_map__.php
··· 160 160 'ConpherenceQueryThreadConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceQueryThreadConduitAPIMethod.php', 161 161 'ConpherenceQueryTransactionConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceQueryTransactionConduitAPIMethod.php', 162 162 'ConpherenceReplyHandler' => 'applications/conpherence/mail/ConpherenceReplyHandler.php', 163 + 'ConpherenceSchemaSpec' => 'applications/conpherence/storage/ConpherenceSchemaSpec.php', 163 164 'ConpherenceSettings' => 'applications/conpherence/constants/ConpherenceSettings.php', 164 165 'ConpherenceThread' => 'applications/conpherence/storage/ConpherenceThread.php', 165 166 'ConpherenceThreadListView' => 'applications/conpherence/view/ConpherenceThreadListView.php', ··· 1486 1487 'PhabricatorDashboardRemarkupRule' => 'applications/dashboard/remarkup/PhabricatorDashboardRemarkupRule.php', 1487 1488 'PhabricatorDashboardRemovePanelController' => 'applications/dashboard/controller/PhabricatorDashboardRemovePanelController.php', 1488 1489 'PhabricatorDashboardRenderingEngine' => 'applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php', 1490 + 'PhabricatorDashboardSchemaSpec' => 'applications/dashboard/storage/PhabricatorDashboardSchemaSpec.php', 1489 1491 'PhabricatorDashboardSearchEngine' => 'applications/dashboard/query/PhabricatorDashboardSearchEngine.php', 1490 1492 'PhabricatorDashboardTransaction' => 'applications/dashboard/storage/PhabricatorDashboardTransaction.php', 1491 1493 'PhabricatorDashboardTransactionEditor' => 'applications/dashboard/editor/PhabricatorDashboardTransactionEditor.php', ··· 2966 2968 'ConpherenceQueryThreadConduitAPIMethod' => 'ConpherenceConduitAPIMethod', 2967 2969 'ConpherenceQueryTransactionConduitAPIMethod' => 'ConpherenceConduitAPIMethod', 2968 2970 'ConpherenceReplyHandler' => 'PhabricatorMailReplyHandler', 2971 + 'ConpherenceSchemaSpec' => 'PhabricatorConfigSchemaSpec', 2969 2972 'ConpherenceSettings' => 'ConpherenceConstants', 2970 2973 'ConpherenceThread' => array( 2971 2974 'ConpherenceDAO', ··· 4402 4405 'PhabricatorDashboardRemarkupRule' => 'PhabricatorObjectRemarkupRule', 4403 4406 'PhabricatorDashboardRemovePanelController' => 'PhabricatorDashboardController', 4404 4407 'PhabricatorDashboardRenderingEngine' => 'Phobject', 4408 + 'PhabricatorDashboardSchemaSpec' => 'PhabricatorConfigSchemaSpec', 4405 4409 'PhabricatorDashboardSearchEngine' => 'PhabricatorApplicationSearchEngine', 4406 4410 'PhabricatorDashboardTransaction' => 'PhabricatorApplicationTransaction', 4407 4411 'PhabricatorDashboardTransactionEditor' => 'PhabricatorApplicationTransactionEditor',
+41 -1
src/applications/config/schema/PhabricatorConfigSchemaSpec.php
··· 88 88 } 89 89 90 90 foreach ($keys as $key_name => $key_spec) { 91 + if ($key_spec === null) { 92 + // This is a subclass removing a key which Lisk expects. 93 + continue; 94 + } 95 + 91 96 $key = $this->newKey($key_name) 92 97 ->setColumnNames(idx($key_spec, 'columns', array())); 93 98 ··· 97 102 $database->addTable($table); 98 103 } 99 104 100 - protected function buildEdgeSchemata(PhabricatorLiskDAO $object) {} 105 + protected function buildEdgeSchemata(PhabricatorLiskDAO $object) { 106 + $this->buildRawSchema( 107 + $object->getApplicationName(), 108 + PhabricatorEdgeConfig::TABLE_NAME_EDGE, 109 + array( 110 + 'src' => 'phid', 111 + 'type' => 'uint32', 112 + 'dst' => 'phid', 113 + 'dateCreated' => 'epoch', 114 + 'seq' => 'uint32', 115 + 'dataID' => 'id?', 116 + ), 117 + array( 118 + 'PRIMARY' => array( 119 + 'columns' => array('src', 'type', 'dst'), 120 + ), 121 + )); 122 + 123 + $this->buildRawSchema( 124 + $object->getApplicationName(), 125 + PhabricatorEdgeConfig::TABLE_NAME_EDGEDATA, 126 + array( 127 + 'id' => 'id', 128 + 'data' => 'text', 129 + ), 130 + array( 131 + 'PRIMARY' => array( 132 + 'columns' => array('id'), 133 + ), 134 + )); 135 + } 101 136 102 137 protected function getDatabase($name) { 103 138 $server = $this->getServer(); ··· 199 234 break; 200 235 case 'text32': 201 236 $column_type = 'varchar(32)'; 237 + $charset = $this->getUTF8Charset(); 238 + $collation = $this->getUTF8Collation(); 239 + break; 240 + case 'text20': 241 + $column_type = 'varchar(20)'; 202 242 $charset = $this->getUTF8Charset(); 203 243 $collation = $this->getUTF8Collation(); 204 244 break;
+10
src/applications/conpherence/storage/ConpherenceParticipant.php
··· 15 15 self::CONFIG_SERIALIZATION => array( 16 16 'settings' => self::SERIALIZATION_JSON, 17 17 ), 18 + self::CONFIG_COLUMN_SCHEMA => array( 19 + 'participationStatus' => 'uint32', 20 + 'dateTouched' => 'epoch', 21 + 'seenMessageCount' => 'uint64', 22 + ), 23 + self::CONFIG_KEY_SCHEMA => array( 24 + 'conpherencePHID' => array( 25 + 'columns' => array('conpherencePHID', 'participantPHID'), 26 + ), 27 + ), 18 28 ) + parent::getConfiguration(); 19 29 } 20 30
+16
src/applications/conpherence/storage/ConpherenceSchemaSpec.php
··· 1 + <?php 2 + 3 + final class ConpherenceSchemaSpec 4 + extends PhabricatorConfigSchemaSpec { 5 + 6 + public function buildSchemata() { 7 + $this->buildLiskSchemata('ConpherenceDAO'); 8 + 9 + $this->buildEdgeSchemata(new ConpherenceThread()); 10 + 11 + $this->buildTransactionSchema( 12 + new ConpherenceTransaction(), 13 + new ConpherenceTransactionComment()); 14 + } 15 + 16 + }
+11
src/applications/conpherence/storage/ConpherenceThread.php
··· 27 27 self::CONFIG_SERIALIZATION => array( 28 28 'recentParticipantPHIDs' => self::SERIALIZATION_JSON, 29 29 ), 30 + self::CONFIG_COLUMN_SCHEMA => array( 31 + 'title' => 'text255?', 32 + 'messageCount' => 'uint64', 33 + 'mailKey' => 'text20', 34 + ), 35 + self::CONFIG_KEY_SCHEMA => array( 36 + 'key_phid' => null, 37 + 'phid' => array( 38 + 'columns' => array('phid'), 39 + ), 40 + ), 30 41 ) + parent::getConfiguration(); 31 42 } 32 43
+8
src/applications/conpherence/storage/ConpherenceTransactionComment.php
··· 9 9 return new ConpherenceTransaction(); 10 10 } 11 11 12 + public function getConfiguration() { 13 + $config = parent::getConfiguration(); 14 + $config[self::CONFIG_COLUMN_SCHEMA] = array( 15 + 'conpherencePHID' => 'phid?', 16 + ) + $config[self::CONFIG_COLUMN_SCHEMA]; 17 + return $config; 18 + } 19 + 12 20 }
+17
src/applications/dashboard/storage/PhabricatorDashboardSchemaSpec.php
··· 1 + <?php 2 + 3 + final class PhabricatorDashboardSchemaSpec 4 + extends PhabricatorConfigSchemaSpec { 5 + 6 + public function buildSchemata() { 7 + $this->buildLiskSchemata('PhabricatorDashboardDAO'); 8 + 9 + $this->buildEdgeSchemata(new PhabricatorDashboard()); 10 + 11 + $this->buildTransactionSchema( 12 + new PhabricatorDashboardTransaction()); 13 + $this->buildTransactionSchema( 14 + new PhabricatorDashboardPanelTransaction()); 15 + } 16 + 17 + }