diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -160,6 +160,7 @@ 'ConpherenceQueryThreadConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceQueryThreadConduitAPIMethod.php', 'ConpherenceQueryTransactionConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceQueryTransactionConduitAPIMethod.php', 'ConpherenceReplyHandler' => 'applications/conpherence/mail/ConpherenceReplyHandler.php', + 'ConpherenceSchemaSpec' => 'applications/conpherence/storage/ConpherenceSchemaSpec.php', 'ConpherenceSettings' => 'applications/conpherence/constants/ConpherenceSettings.php', 'ConpherenceThread' => 'applications/conpherence/storage/ConpherenceThread.php', 'ConpherenceThreadListView' => 'applications/conpherence/view/ConpherenceThreadListView.php', @@ -1486,6 +1487,7 @@ 'PhabricatorDashboardRemarkupRule' => 'applications/dashboard/remarkup/PhabricatorDashboardRemarkupRule.php', 'PhabricatorDashboardRemovePanelController' => 'applications/dashboard/controller/PhabricatorDashboardRemovePanelController.php', 'PhabricatorDashboardRenderingEngine' => 'applications/dashboard/engine/PhabricatorDashboardRenderingEngine.php', + 'PhabricatorDashboardSchemaSpec' => 'applications/dashboard/storage/PhabricatorDashboardSchemaSpec.php', 'PhabricatorDashboardSearchEngine' => 'applications/dashboard/query/PhabricatorDashboardSearchEngine.php', 'PhabricatorDashboardTransaction' => 'applications/dashboard/storage/PhabricatorDashboardTransaction.php', 'PhabricatorDashboardTransactionEditor' => 'applications/dashboard/editor/PhabricatorDashboardTransactionEditor.php', @@ -2966,6 +2968,7 @@ 'ConpherenceQueryThreadConduitAPIMethod' => 'ConpherenceConduitAPIMethod', 'ConpherenceQueryTransactionConduitAPIMethod' => 'ConpherenceConduitAPIMethod', 'ConpherenceReplyHandler' => 'PhabricatorMailReplyHandler', + 'ConpherenceSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'ConpherenceSettings' => 'ConpherenceConstants', 'ConpherenceThread' => array( 'ConpherenceDAO', @@ -4402,6 +4405,7 @@ 'PhabricatorDashboardRemarkupRule' => 'PhabricatorObjectRemarkupRule', 'PhabricatorDashboardRemovePanelController' => 'PhabricatorDashboardController', 'PhabricatorDashboardRenderingEngine' => 'Phobject', + 'PhabricatorDashboardSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorDashboardSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorDashboardTransaction' => 'PhabricatorApplicationTransaction', 'PhabricatorDashboardTransactionEditor' => 'PhabricatorApplicationTransactionEditor', diff --git a/src/applications/config/schema/PhabricatorConfigSchemaSpec.php b/src/applications/config/schema/PhabricatorConfigSchemaSpec.php --- a/src/applications/config/schema/PhabricatorConfigSchemaSpec.php +++ b/src/applications/config/schema/PhabricatorConfigSchemaSpec.php @@ -88,6 +88,11 @@ } foreach ($keys as $key_name => $key_spec) { + if ($key_spec === null) { + // This is a subclass removing a key which Lisk expects. + continue; + } + $key = $this->newKey($key_name) ->setColumnNames(idx($key_spec, 'columns', array())); @@ -97,7 +102,37 @@ $database->addTable($table); } - protected function buildEdgeSchemata(PhabricatorLiskDAO $object) {} + protected function buildEdgeSchemata(PhabricatorLiskDAO $object) { + $this->buildRawSchema( + $object->getApplicationName(), + PhabricatorEdgeConfig::TABLE_NAME_EDGE, + array( + 'src' => 'phid', + 'type' => 'uint32', + 'dst' => 'phid', + 'dateCreated' => 'epoch', + 'seq' => 'uint32', + 'dataID' => 'id?', + ), + array( + 'PRIMARY' => array( + 'columns' => array('src', 'type', 'dst'), + ), + )); + + $this->buildRawSchema( + $object->getApplicationName(), + PhabricatorEdgeConfig::TABLE_NAME_EDGEDATA, + array( + 'id' => 'id', + 'data' => 'text', + ), + array( + 'PRIMARY' => array( + 'columns' => array('id'), + ), + )); + } protected function getDatabase($name) { $server = $this->getServer(); @@ -202,6 +237,11 @@ $charset = $this->getUTF8Charset(); $collation = $this->getUTF8Collation(); break; + case 'text20': + $column_type = 'varchar(20)'; + $charset = $this->getUTF8Charset(); + $collation = $this->getUTF8Collation(); + break; case 'text16': $column_type = 'varchar(16)'; $charset = $this->getUTF8Charset(); diff --git a/src/applications/conpherence/storage/ConpherenceParticipant.php b/src/applications/conpherence/storage/ConpherenceParticipant.php --- a/src/applications/conpherence/storage/ConpherenceParticipant.php +++ b/src/applications/conpherence/storage/ConpherenceParticipant.php @@ -15,6 +15,16 @@ self::CONFIG_SERIALIZATION => array( 'settings' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'participationStatus' => 'uint32', + 'dateTouched' => 'epoch', + 'seenMessageCount' => 'uint64', + ), + self::CONFIG_KEY_SCHEMA => array( + 'conpherencePHID' => array( + 'columns' => array('conpherencePHID', 'participantPHID'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/conpherence/storage/ConpherenceSchemaSpec.php b/src/applications/conpherence/storage/ConpherenceSchemaSpec.php new file mode 100644 --- /dev/null +++ b/src/applications/conpherence/storage/ConpherenceSchemaSpec.php @@ -0,0 +1,16 @@ +buildLiskSchemata('ConpherenceDAO'); + + $this->buildEdgeSchemata(new ConpherenceThread()); + + $this->buildTransactionSchema( + new ConpherenceTransaction(), + new ConpherenceTransactionComment()); + } + +} diff --git a/src/applications/conpherence/storage/ConpherenceThread.php b/src/applications/conpherence/storage/ConpherenceThread.php --- a/src/applications/conpherence/storage/ConpherenceThread.php +++ b/src/applications/conpherence/storage/ConpherenceThread.php @@ -27,6 +27,17 @@ self::CONFIG_SERIALIZATION => array( 'recentParticipantPHIDs' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'title' => 'text255?', + 'messageCount' => 'uint64', + 'mailKey' => 'text20', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_phid' => null, + 'phid' => array( + 'columns' => array('phid'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/conpherence/storage/ConpherenceTransactionComment.php b/src/applications/conpherence/storage/ConpherenceTransactionComment.php --- a/src/applications/conpherence/storage/ConpherenceTransactionComment.php +++ b/src/applications/conpherence/storage/ConpherenceTransactionComment.php @@ -9,4 +9,12 @@ return new ConpherenceTransaction(); } + public function getConfiguration() { + $config = parent::getConfiguration(); + $config[self::CONFIG_COLUMN_SCHEMA] = array( + 'conpherencePHID' => 'phid?', + ) + $config[self::CONFIG_COLUMN_SCHEMA]; + return $config; + } + } diff --git a/src/applications/dashboard/storage/PhabricatorDashboardSchemaSpec.php b/src/applications/dashboard/storage/PhabricatorDashboardSchemaSpec.php new file mode 100644 --- /dev/null +++ b/src/applications/dashboard/storage/PhabricatorDashboardSchemaSpec.php @@ -0,0 +1,17 @@ +buildLiskSchemata('PhabricatorDashboardDAO'); + + $this->buildEdgeSchemata(new PhabricatorDashboard()); + + $this->buildTransactionSchema( + new PhabricatorDashboardTransaction()); + $this->buildTransactionSchema( + new PhabricatorDashboardPanelTransaction()); + } + +}