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 @@ -2266,6 +2266,7 @@ 'PhabricatorSlowvotePollController' => 'applications/slowvote/controller/PhabricatorSlowvotePollController.php', 'PhabricatorSlowvotePollPHIDType' => 'applications/slowvote/phid/PhabricatorSlowvotePollPHIDType.php', 'PhabricatorSlowvoteQuery' => 'applications/slowvote/query/PhabricatorSlowvoteQuery.php', + 'PhabricatorSlowvoteSchemaSpec' => 'applications/slowvote/storage/PhabricatorSlowvoteSchemaSpec.php', 'PhabricatorSlowvoteSearchEngine' => 'applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php', 'PhabricatorSlowvoteTransaction' => 'applications/slowvote/storage/PhabricatorSlowvoteTransaction.php', 'PhabricatorSlowvoteTransactionComment' => 'applications/slowvote/storage/PhabricatorSlowvoteTransactionComment.php', @@ -2322,6 +2323,7 @@ 'PhabricatorSystemRemoveDestroyWorkflow' => 'applications/system/management/PhabricatorSystemRemoveDestroyWorkflow.php', 'PhabricatorSystemRemoveLogWorkflow' => 'applications/system/management/PhabricatorSystemRemoveLogWorkflow.php', 'PhabricatorSystemRemoveWorkflow' => 'applications/system/management/PhabricatorSystemRemoveWorkflow.php', + 'PhabricatorSystemSchemaSpec' => 'applications/system/storage/PhabricatorSystemSchemaSpec.php', 'PhabricatorSystemSelectEncodingController' => 'applications/system/controller/PhabricatorSystemSelectEncodingController.php', 'PhabricatorSystemSelectHighlightController' => 'applications/system/controller/PhabricatorSystemSelectHighlightController.php', 'PhabricatorTaskmasterDaemon' => 'infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php', @@ -2349,6 +2351,7 @@ 'PhabricatorTokenQuery' => 'applications/tokens/query/PhabricatorTokenQuery.php', 'PhabricatorTokenReceiverInterface' => 'applications/tokens/interface/PhabricatorTokenReceiverInterface.php', 'PhabricatorTokenReceiverQuery' => 'applications/tokens/query/PhabricatorTokenReceiverQuery.php', + 'PhabricatorTokenSchemaSpec' => 'applications/tokens/storage/PhabricatorTokenSchemaSpec.php', 'PhabricatorTokenTokenPHIDType' => 'applications/tokens/phid/PhabricatorTokenTokenPHIDType.php', 'PhabricatorTokenUIEventListener' => 'applications/tokens/event/PhabricatorTokenUIEventListener.php', 'PhabricatorTokensApplication' => 'applications/tokens/application/PhabricatorTokensApplication.php', @@ -2417,6 +2420,7 @@ 'PhabricatorWorkerDAO' => 'infrastructure/daemon/workers/storage/PhabricatorWorkerDAO.php', 'PhabricatorWorkerLeaseQuery' => 'infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php', 'PhabricatorWorkerPermanentFailureException' => 'infrastructure/daemon/workers/exception/PhabricatorWorkerPermanentFailureException.php', + 'PhabricatorWorkerSchemaSpec' => 'infrastructure/daemon/workers/storage/PhabricatorWorkerSchemaSpec.php', 'PhabricatorWorkerTask' => 'infrastructure/daemon/workers/storage/PhabricatorWorkerTask.php', 'PhabricatorWorkerTaskData' => 'infrastructure/daemon/workers/storage/PhabricatorWorkerTaskData.php', 'PhabricatorWorkerTaskDetailController' => 'applications/daemon/controller/PhabricatorWorkerTaskDetailController.php', @@ -2434,6 +2438,7 @@ 'PhabricatorXHPASTViewPanelController' => 'applications/phpast/controller/PhabricatorXHPASTViewPanelController.php', 'PhabricatorXHPASTViewParseTree' => 'applications/phpast/storage/PhabricatorXHPASTViewParseTree.php', 'PhabricatorXHPASTViewRunController' => 'applications/phpast/controller/PhabricatorXHPASTViewRunController.php', + 'PhabricatorXHPASTViewSchemaSpec' => 'applications/phpast/storage/PhabricatorXHPASTViewSchemaSpec.php', 'PhabricatorXHPASTViewStreamController' => 'applications/phpast/controller/PhabricatorXHPASTViewStreamController.php', 'PhabricatorXHPASTViewTreeController' => 'applications/phpast/controller/PhabricatorXHPASTViewTreeController.php', 'PhabricatorXHProfApplication' => 'applications/xhprof/application/PhabricatorXHProfApplication.php', @@ -2445,6 +2450,7 @@ 'PhabricatorXHProfProfileView' => 'applications/xhprof/view/PhabricatorXHProfProfileView.php', 'PhabricatorXHProfSample' => 'applications/xhprof/storage/PhabricatorXHProfSample.php', 'PhabricatorXHProfSampleListController' => 'applications/xhprof/controller/PhabricatorXHProfSampleListController.php', + 'PhabricatorXHProfSchemaSpec' => 'applications/xhprof/storage/PhabricatorXHProfSchemaSpec.php', 'PhabricatorYoutubeRemarkupRule' => 'infrastructure/markup/rule/PhabricatorYoutubeRemarkupRule.php', 'PhameBasicBlogSkin' => 'applications/phame/skins/PhameBasicBlogSkin.php', 'PhameBasicTemplateBlogSkin' => 'applications/phame/skins/PhameBasicTemplateBlogSkin.php', @@ -5239,6 +5245,7 @@ 'PhabricatorSlowvotePollController' => 'PhabricatorSlowvoteController', 'PhabricatorSlowvotePollPHIDType' => 'PhabricatorPHIDType', 'PhabricatorSlowvoteQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', + 'PhabricatorSlowvoteSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorSlowvoteSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorSlowvoteTransaction' => 'PhabricatorApplicationTransaction', 'PhabricatorSlowvoteTransactionComment' => 'PhabricatorApplicationTransactionComment', @@ -5287,6 +5294,7 @@ 'PhabricatorSystemRemoveDestroyWorkflow' => 'PhabricatorSystemRemoveWorkflow', 'PhabricatorSystemRemoveLogWorkflow' => 'PhabricatorSystemRemoveWorkflow', 'PhabricatorSystemRemoveWorkflow' => 'PhabricatorManagementWorkflow', + 'PhabricatorSystemSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorSystemSelectEncodingController' => 'PhabricatorController', 'PhabricatorSystemSelectHighlightController' => 'PhabricatorController', 'PhabricatorTaskmasterDaemon' => 'PhabricatorDaemon', @@ -5316,6 +5324,7 @@ 'PhabricatorTokenLeaderController' => 'PhabricatorTokenController', 'PhabricatorTokenQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorTokenReceiverQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', + 'PhabricatorTokenSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorTokenTokenPHIDType' => 'PhabricatorPHIDType', 'PhabricatorTokenUIEventListener' => 'PhabricatorEventListener', 'PhabricatorTokensApplication' => 'PhabricatorApplication', @@ -5391,6 +5400,7 @@ 'PhabricatorWorkerDAO' => 'PhabricatorLiskDAO', 'PhabricatorWorkerLeaseQuery' => 'PhabricatorQuery', 'PhabricatorWorkerPermanentFailureException' => 'Exception', + 'PhabricatorWorkerSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorWorkerTask' => 'PhabricatorWorkerDAO', 'PhabricatorWorkerTaskData' => 'PhabricatorWorkerDAO', 'PhabricatorWorkerTaskDetailController' => 'PhabricatorDaemonController', @@ -5408,6 +5418,7 @@ 'PhabricatorXHPASTViewPanelController' => 'PhabricatorXHPASTViewController', 'PhabricatorXHPASTViewParseTree' => 'PhabricatorXHPASTViewDAO', 'PhabricatorXHPASTViewRunController' => 'PhabricatorXHPASTViewController', + 'PhabricatorXHPASTViewSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorXHPASTViewStreamController' => 'PhabricatorXHPASTViewPanelController', 'PhabricatorXHPASTViewTreeController' => 'PhabricatorXHPASTViewPanelController', 'PhabricatorXHProfApplication' => 'PhabricatorApplication', @@ -5419,6 +5430,7 @@ 'PhabricatorXHProfProfileView' => 'AphrontView', 'PhabricatorXHProfSample' => 'PhabricatorXHProfDAO', 'PhabricatorXHProfSampleListController' => 'PhabricatorXHProfController', + 'PhabricatorXHProfSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorYoutubeRemarkupRule' => 'PhutilRemarkupRule', 'PhameBasicBlogSkin' => 'PhameBlogSkin', 'PhameBasicTemplateBlogSkin' => 'PhameBasicBlogSkin', 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 @@ -138,6 +138,21 @@ )); } + public function buildCounterSchema(PhabricatorLiskDAO $object) { + $this->buildRawSchema( + $object->getApplicationName(), + PhabricatorLiskDAO::COUNTER_TABLE_NAME, + array( + 'counterName' => 'text32', + 'counterValue' => 'id64', + ), + array( + 'PRIMARY' => array( + 'columns' => array('counterName'), + ), + )); + } + protected function getDatabase($name) { $server = $this->getServer(); @@ -274,6 +289,9 @@ case 'bool': $column_type = 'tinyint(1)'; break; + case 'double': + $column_type = 'double'; + break; default: $column_type = pht(''); $charset = pht(''); diff --git a/src/applications/phpast/storage/PhabricatorXHPASTViewParseTree.php b/src/applications/phpast/storage/PhabricatorXHPASTViewParseTree.php --- a/src/applications/phpast/storage/PhabricatorXHPASTViewParseTree.php +++ b/src/applications/phpast/storage/PhabricatorXHPASTViewParseTree.php @@ -6,4 +6,14 @@ protected $input; protected $stdout; + + public function getConfiguration() { + return array( + self::CONFIG_COLUMN_SCHEMA => array( + 'authorPHID' => 'phid?', + 'input' => 'text', + 'stdout' => 'text', + ), + ) + parent::getConfiguration(); + } } diff --git a/src/applications/phpast/storage/PhabricatorXHPASTViewSchemaSpec.php b/src/applications/phpast/storage/PhabricatorXHPASTViewSchemaSpec.php new file mode 100644 --- /dev/null +++ b/src/applications/phpast/storage/PhabricatorXHPASTViewSchemaSpec.php @@ -0,0 +1,10 @@ +buildLiskSchemata('PhabricatorXHPASTViewDAO'); + } + +} diff --git a/src/applications/slowvote/storage/PhabricatorSlowvoteOption.php b/src/applications/slowvote/storage/PhabricatorSlowvoteOption.php --- a/src/applications/slowvote/storage/PhabricatorSlowvoteOption.php +++ b/src/applications/slowvote/storage/PhabricatorSlowvoteOption.php @@ -5,4 +5,12 @@ protected $pollID; protected $name; + public function getConfiguration() { + return array( + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text255', + ), + ) + parent::getConfiguration(); + } + } diff --git a/src/applications/slowvote/storage/PhabricatorSlowvotePoll.php b/src/applications/slowvote/storage/PhabricatorSlowvotePoll.php --- a/src/applications/slowvote/storage/PhabricatorSlowvotePoll.php +++ b/src/applications/slowvote/storage/PhabricatorSlowvotePoll.php @@ -46,6 +46,20 @@ public function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, + self::CONFIG_COLUMN_SCHEMA => array( + 'question' => 'text255', + 'responseVisibility' => 'uint32', + 'shuffle' => 'uint32', + 'method' => 'uint32', + 'description' => 'text', + 'isClosed' => 'bool', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_phid' => null, + 'phid' => array( + 'columns' => array('phid'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/slowvote/storage/PhabricatorSlowvoteSchemaSpec.php b/src/applications/slowvote/storage/PhabricatorSlowvoteSchemaSpec.php new file mode 100644 --- /dev/null +++ b/src/applications/slowvote/storage/PhabricatorSlowvoteSchemaSpec.php @@ -0,0 +1,14 @@ +buildLiskSchemata('PhabricatorSlowvoteDAO'); + $this->buildEdgeSchemata(new PhabricatorSlowvotePoll()); + $this->buildTransactionSchema( + new PhabricatorSlowvoteTransaction(), + new PhabricatorSlowvoteTransactionComment()); + } + +} diff --git a/src/applications/system/storage/PhabricatorSystemActionLog.php b/src/applications/system/storage/PhabricatorSystemActionLog.php --- a/src/applications/system/storage/PhabricatorSystemActionLog.php +++ b/src/applications/system/storage/PhabricatorSystemActionLog.php @@ -11,6 +11,12 @@ public function getConfiguration() { return array( self::CONFIG_TIMESTAMPS => false, + self::CONFIG_COLUMN_SCHEMA => array( + 'actorHash' => 'bytes12', + 'actorIdentity' => 'text255', + 'action' => 'text32', + 'score' => 'double', + ), ) + parent::getConfiguration(); } diff --git a/src/applications/system/storage/PhabricatorSystemDestructionLog.php b/src/applications/system/storage/PhabricatorSystemDestructionLog.php --- a/src/applications/system/storage/PhabricatorSystemDestructionLog.php +++ b/src/applications/system/storage/PhabricatorSystemDestructionLog.php @@ -11,6 +11,12 @@ public function getConfiguration() { return array( self::CONFIG_TIMESTAMPS => false, + self::CONFIG_COLUMN_SCHEMA => array( + 'objectClass' => 'text128', + 'rootLogID' => 'id?', + 'objectPHID' => 'phid?', + 'objectMonogram' => 'text64?', + ), ) + parent::getConfiguration(); } diff --git a/src/applications/system/storage/PhabricatorSystemSchemaSpec.php b/src/applications/system/storage/PhabricatorSystemSchemaSpec.php new file mode 100644 --- /dev/null +++ b/src/applications/system/storage/PhabricatorSystemSchemaSpec.php @@ -0,0 +1,10 @@ +buildLiskSchemata('PhabricatorSystemDAO'); + } + +} diff --git a/src/applications/tokens/storage/PhabricatorTokenCount.php b/src/applications/tokens/storage/PhabricatorTokenCount.php --- a/src/applications/tokens/storage/PhabricatorTokenCount.php +++ b/src/applications/tokens/storage/PhabricatorTokenCount.php @@ -9,6 +9,14 @@ return array( self::CONFIG_IDS => self::IDS_MANUAL, self::CONFIG_TIMESTAMPS => false, + self::CONFIG_COLUMN_SCHEMA => array( + 'tokenCount' => 'uint32', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_objectPHID' => array( + 'columns' => array('objectPHID'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/tokens/storage/PhabricatorTokenGiven.php b/src/applications/tokens/storage/PhabricatorTokenGiven.php --- a/src/applications/tokens/storage/PhabricatorTokenGiven.php +++ b/src/applications/tokens/storage/PhabricatorTokenGiven.php @@ -9,6 +9,16 @@ private $object = self::ATTACHABLE; + public function getConfiguration() { + return array( + self::CONFIG_KEY_SCHEMA => array( + 'key_all' => array( + 'columns' => array('objectPHID', 'authorPHID'), + ), + ), + ) + parent::getConfiguration(); + } + public function attachObject(PhabricatorTokenReceiverInterface $object) { $this->object = $object; return $this; diff --git a/src/applications/tokens/storage/PhabricatorTokenSchemaSpec.php b/src/applications/tokens/storage/PhabricatorTokenSchemaSpec.php new file mode 100644 --- /dev/null +++ b/src/applications/tokens/storage/PhabricatorTokenSchemaSpec.php @@ -0,0 +1,10 @@ +buildLiskSchemata('PhabricatorTokenDAO'); + } + +} diff --git a/src/applications/xhprof/storage/PhabricatorXHProfSample.php b/src/applications/xhprof/storage/PhabricatorXHProfSample.php --- a/src/applications/xhprof/storage/PhabricatorXHProfSample.php +++ b/src/applications/xhprof/storage/PhabricatorXHProfSample.php @@ -9,4 +9,23 @@ protected $requestPath; protected $controller; protected $userPHID; + + public function getConfiguration() { + return array( + self::CONFIG_COLUMN_SCHEMA => array( + 'sampleRate' => 'uint32', + 'usTotal' => 'uint64', + 'hostname' => 'text255?', + 'requestPath' => 'text255?', + 'controller' => 'text255?', + 'userPHID' => 'phid?', + ), + self::CONFIG_KEY_SCHEMA => array( + 'filePHID' => array( + 'columns' => array('filePHID'), + ), + ), + ) + parent::getConfiguration(); + } + } diff --git a/src/applications/xhprof/storage/PhabricatorXHProfSchemaSpec.php b/src/applications/xhprof/storage/PhabricatorXHProfSchemaSpec.php new file mode 100644 --- /dev/null +++ b/src/applications/xhprof/storage/PhabricatorXHProfSchemaSpec.php @@ -0,0 +1,10 @@ +buildLiskSchemata('PhabricatorXHProfDAO'); + } + +} diff --git a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php --- a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php +++ b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php @@ -11,6 +11,11 @@ return array( self::CONFIG_IDS => self::IDS_COUNTER, self::CONFIG_TIMESTAMPS => false, + self::CONFIG_KEY_SCHEMA => array( + 'dataID' => array( + 'columns' => array('dataID'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php --- a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php +++ b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php @@ -9,6 +9,15 @@ protected $duration; protected $result; + public function getConfiguration() { + $config = parent::getConfiguration(); + $config[self::CONFIG_COLUMN_SCHEMA] = array( + 'result' => 'uint32', + 'duration' => 'uint64', + ) + $config[self::CONFIG_COLUMN_SCHEMA]; + return $config; + } + public function save() { if ($this->getID() === null) { throw new Exception('Trying to archive a task with no ID.'); diff --git a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerSchemaSpec.php b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerSchemaSpec.php new file mode 100644 --- /dev/null +++ b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerSchemaSpec.php @@ -0,0 +1,11 @@ +buildLiskSchemata('PhabricatorWorkerDAO'); + $this->buildCounterSchema(new PhabricatorWorkerActiveTask()); + } + +} diff --git a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerTask.php b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerTask.php --- a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerTask.php +++ b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerTask.php @@ -14,6 +14,19 @@ private $data; private $executionException; + public function getConfiguration() { + return array( + self::CONFIG_COLUMN_SCHEMA => array( + 'taskClass' => 'text255', + 'leaseOwner' => 'text255?', + 'leaseExpires' => 'epoch?', + 'failureCount' => 'uint32', + 'failureTime' => 'epoch?', + 'priority' => 'uint32', + ), + ) + parent::getConfiguration(); + } + final public function setExecutionException(Exception $execution_exception) { $this->executionException = $execution_exception; return $this;