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 @@ -550,6 +550,7 @@ 'DivinerPublisher' => 'applications/diviner/publisher/DivinerPublisher.php', 'DivinerRenderer' => 'applications/diviner/renderer/DivinerRenderer.php', 'DivinerReturnTableView' => 'applications/diviner/view/DivinerReturnTableView.php', + 'DivinerSchemaSpec' => 'applications/diviner/storage/DivinerSchemaSpec.php', 'DivinerSectionView' => 'applications/diviner/view/DivinerSectionView.php', 'DivinerStaticPublisher' => 'applications/diviner/publisher/DivinerStaticPublisher.php', 'DivinerSymbolRemarkupRule' => 'applications/diviner/markup/DivinerSymbolRemarkupRule.php', @@ -820,6 +821,7 @@ 'HeraldRuleTranscript' => 'applications/herald/storage/transcript/HeraldRuleTranscript.php', 'HeraldRuleTypeConfig' => 'applications/herald/config/HeraldRuleTypeConfig.php', 'HeraldRuleViewController' => 'applications/herald/controller/HeraldRuleViewController.php', + 'HeraldSchemaSpec' => 'applications/herald/storage/HeraldSchemaSpec.php', 'HeraldTestConsoleController' => 'applications/herald/controller/HeraldTestConsoleController.php', 'HeraldTransactionQuery' => 'applications/herald/query/HeraldTransactionQuery.php', 'HeraldTranscript' => 'applications/herald/storage/transcript/HeraldTranscript.php', @@ -1572,6 +1574,7 @@ 'PhabricatorFactManagementStatusWorkflow' => 'applications/fact/management/PhabricatorFactManagementStatusWorkflow.php', 'PhabricatorFactManagementWorkflow' => 'applications/fact/management/PhabricatorFactManagementWorkflow.php', 'PhabricatorFactRaw' => 'applications/fact/storage/PhabricatorFactRaw.php', + 'PhabricatorFactSchemaSpec' => 'applications/fact/storage/PhabricatorFactSchemaSpec.php', 'PhabricatorFactSimpleSpec' => 'applications/fact/spec/PhabricatorFactSimpleSpec.php', 'PhabricatorFactSpec' => 'applications/fact/spec/PhabricatorFactSpec.php', 'PhabricatorFactUpdateIterator' => 'applications/fact/extract/PhabricatorFactUpdateIterator.php', @@ -1896,6 +1899,7 @@ 'PhabricatorOwnersPackageQuery' => 'applications/owners/query/PhabricatorOwnersPackageQuery.php', 'PhabricatorOwnersPackageTestCase' => 'applications/owners/storage/__tests__/PhabricatorOwnersPackageTestCase.php', 'PhabricatorOwnersPath' => 'applications/owners/storage/PhabricatorOwnersPath.php', + 'PhabricatorOwnersSchemaSpec' => 'applications/owners/storage/PhabricatorOwnersSchemaSpec.php', 'PhabricatorPHDConfigOptions' => 'applications/config/option/PhabricatorPHDConfigOptions.php', 'PhabricatorPHID' => 'applications/phid/storage/PhabricatorPHID.php', 'PhabricatorPHIDConstants' => 'applications/phid/PhabricatorPHIDConstants.php', @@ -3387,6 +3391,7 @@ 'DivinerParameterTableView' => 'AphrontTagView', 'DivinerPublishCache' => 'DivinerDiskCache', 'DivinerReturnTableView' => 'AphrontTagView', + 'DivinerSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'DivinerSectionView' => 'AphrontTagView', 'DivinerStaticPublisher' => 'DivinerPublisher', 'DivinerSymbolRemarkupRule' => 'PhutilRemarkupRule', @@ -3669,7 +3674,7 @@ 'HarbormasterWaitForPreviousBuildStepImplementation' => 'HarbormasterBuildStepImplementation', 'HarbormasterWorker' => 'PhabricatorWorker', 'HeraldAction' => 'HeraldDAO', - 'HeraldApplyTranscript' => 'HeraldDAO', + 'HeraldApplyTranscript' => 'Phobject', 'HeraldCommitAdapter' => 'HeraldAdapter', 'HeraldCondition' => 'HeraldDAO', 'HeraldController' => 'PhabricatorController', @@ -3709,6 +3714,7 @@ 'HeraldRuleTransaction' => 'PhabricatorApplicationTransaction', 'HeraldRuleTransactionComment' => 'PhabricatorApplicationTransactionComment', 'HeraldRuleViewController' => 'HeraldController', + 'HeraldSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'HeraldTestConsoleController' => 'HeraldController', 'HeraldTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'HeraldTranscript' => array( @@ -4523,6 +4529,7 @@ 'PhabricatorFactManagementStatusWorkflow' => 'PhabricatorFactManagementWorkflow', 'PhabricatorFactManagementWorkflow' => 'PhabricatorManagementWorkflow', 'PhabricatorFactRaw' => 'PhabricatorFactDAO', + 'PhabricatorFactSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorFactSimpleSpec' => 'PhabricatorFactSpec', 'PhabricatorFactUpdateIterator' => 'PhutilBufferedIterator', 'PhabricatorFeedApplication' => 'PhabricatorApplication', @@ -4847,6 +4854,7 @@ 'PhabricatorOwnersPackageQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorOwnersPackageTestCase' => 'PhabricatorTestCase', 'PhabricatorOwnersPath' => 'PhabricatorOwnersDAO', + 'PhabricatorOwnersSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorPHDConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorPHPASTApplication' => 'PhabricatorApplication', 'PhabricatorPHPMailerConfigOptions' => 'PhabricatorApplicationConfigOptions', diff --git a/src/applications/diviner/storage/DivinerLiveAtom.php b/src/applications/diviner/storage/DivinerLiveAtom.php --- a/src/applications/diviner/storage/DivinerLiveAtom.php +++ b/src/applications/diviner/storage/DivinerLiveAtom.php @@ -13,6 +13,12 @@ 'content' => self::SERIALIZATION_JSON, 'atomData' => self::SERIALIZATION_JSON, ), + self::CONFIG_KEY_SCHEMA => array( + 'symbolPHID' => array( + 'columns' => array('symbolPHID'), + 'unique' => true, + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/diviner/storage/DivinerLiveBook.php b/src/applications/diviner/storage/DivinerLiveBook.php --- a/src/applications/diviner/storage/DivinerLiveBook.php +++ b/src/applications/diviner/storage/DivinerLiveBook.php @@ -13,6 +13,20 @@ self::CONFIG_SERIALIZATION => array( 'configurationData' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text64', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_phid' => null, + 'phid' => array( + 'columns' => array('phid'), + 'unique' => true, + ), + 'name' => array( + 'columns' => array('name'), + 'unique' => true, + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/diviner/storage/DivinerLiveSymbol.php b/src/applications/diviner/storage/DivinerLiveSymbol.php --- a/src/applications/diviner/storage/DivinerLiveSymbol.php +++ b/src/applications/diviner/storage/DivinerLiveSymbol.php @@ -27,6 +27,54 @@ return array( self::CONFIG_AUX_PHID => true, self::CONFIG_TIMESTAMPS => false, + self::CONFIG_COLUMN_SCHEMA => array( + 'context' => 'text255?', + 'type' => 'text32', + 'name' => 'text255', + 'atomIndex' => 'uint32', + 'identityHash' => 'bytes12', + 'graphHash' => 'bytes64?', + 'title' => 'text?', + 'titleSlugHash' => 'bytes12?', + 'groupName' => 'text255?', + 'summary' => 'text?', + 'isDocumentable' => 'bool', + 'nodeHash' => 'bytes64?', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_phid' => null, + 'identityHash' => array( + 'columns' => array('identityHash'), + 'unique' => true, + ), + 'phid' => array( + 'columns' => array('phid'), + 'unique' => true, + ), + 'graphHash' => array( + 'columns' => array('graphHash'), + 'unique' => true, + ), + 'nodeHash' => array( + 'columns' => array('nodeHash'), + 'unique' => true, + ), + 'bookPHID' => array( + 'columns' => array( + 'bookPHID', + 'type', + 'name(64)', + 'context(64)', + 'atomIndex', + ), + ), + 'name' => array( + 'columns' => array('name'), + ), + 'key_slug' => array( + 'columns' => array('titleSlugHash'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/diviner/storage/DivinerSchemaSpec.php b/src/applications/diviner/storage/DivinerSchemaSpec.php new file mode 100644 --- /dev/null +++ b/src/applications/diviner/storage/DivinerSchemaSpec.php @@ -0,0 +1,9 @@ +buildLiskSchemata('DivinerDAO'); + } + +} diff --git a/src/applications/fact/storage/PhabricatorFactAggregate.php b/src/applications/fact/storage/PhabricatorFactAggregate.php --- a/src/applications/fact/storage/PhabricatorFactAggregate.php +++ b/src/applications/fact/storage/PhabricatorFactAggregate.php @@ -2,9 +2,25 @@ final class PhabricatorFactAggregate extends PhabricatorFactDAO { - protected $id; protected $factType; protected $objectPHID; protected $valueX; + public function getConfiguration() { + return array( + self::CONFIG_COLUMN_SCHEMA => array( + 'id' => null, + 'factType' => 'text32', + 'valueX' => 'uint64', + ), + self::CONFIG_KEY_SCHEMA => array( + 'PRIMARY' => null, + 'factType' => array( + 'columns' => array('factType', 'objectPHID'), + 'unique' => true, + ), + ), + ) + parent::getConfiguration(); + } + } diff --git a/src/applications/fact/storage/PhabricatorFactCursor.php b/src/applications/fact/storage/PhabricatorFactCursor.php --- a/src/applications/fact/storage/PhabricatorFactCursor.php +++ b/src/applications/fact/storage/PhabricatorFactCursor.php @@ -2,8 +2,22 @@ final class PhabricatorFactCursor extends PhabricatorFactDAO { - protected $id; protected $name; protected $position; + public function getConfiguration() { + return array( + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text64', + 'position' => 'text64', + ), + self::CONFIG_KEY_SCHEMA => array( + 'name' => array( + 'columns' => array('name'), + 'unique' => true, + ), + ), + ) + parent::getConfiguration(); + } + } diff --git a/src/applications/fact/storage/PhabricatorFactRaw.php b/src/applications/fact/storage/PhabricatorFactRaw.php --- a/src/applications/fact/storage/PhabricatorFactRaw.php +++ b/src/applications/fact/storage/PhabricatorFactRaw.php @@ -5,7 +5,6 @@ */ final class PhabricatorFactRaw extends PhabricatorFactDAO { - protected $id; protected $factType; protected $objectPHID; protected $objectA; @@ -13,4 +12,29 @@ protected $valueY; protected $epoch; + public function getConfiguration() { + return array( + self::CONFIG_COLUMN_SCHEMA => array( + 'id' => null, + 'factType' => 'text32', + 'objectA' => 'phid', + 'valueX' => 'sint64', + 'valueY' => 'sint64', + ), + self::CONFIG_KEY_SCHEMA => array( + 'PRIMARY' => null, + 'objectPHID' => array( + 'columns' => array('objectPHID'), + ), + 'factType' => array( + 'columns' => array('factType', 'epoch'), + ), + 'factType_2' => array( + 'columns' => array('factType', 'objectA'), + ), + ), + ) + parent::getConfiguration(); + } + + } diff --git a/src/applications/fact/storage/PhabricatorFactSchemaSpec.php b/src/applications/fact/storage/PhabricatorFactSchemaSpec.php new file mode 100644 --- /dev/null +++ b/src/applications/fact/storage/PhabricatorFactSchemaSpec.php @@ -0,0 +1,9 @@ +buildLiskSchemata('PhabricatorFactDAO'); + } + +} diff --git a/src/applications/herald/storage/HeraldAction.php b/src/applications/herald/storage/HeraldAction.php --- a/src/applications/herald/storage/HeraldAction.php +++ b/src/applications/herald/storage/HeraldAction.php @@ -13,6 +13,15 @@ 'target' => self::SERIALIZATION_JSON, ), self::CONFIG_TIMESTAMPS => false, + self::CONFIG_COLUMN_SCHEMA => array( + 'action' => 'text255', + 'target' => 'text', + ), + self::CONFIG_KEY_SCHEMA => array( + 'ruleID' => array( + 'columns' => array('ruleID'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/herald/storage/HeraldCondition.php b/src/applications/herald/storage/HeraldCondition.php --- a/src/applications/herald/storage/HeraldCondition.php +++ b/src/applications/herald/storage/HeraldCondition.php @@ -14,6 +14,16 @@ 'value' => self::SERIALIZATION_JSON, ), self::CONFIG_TIMESTAMPS => false, + self::CONFIG_COLUMN_SCHEMA => array( + 'fieldName' => 'text255', + 'fieldCondition' => 'text255', + 'value' => 'text', + ), + self::CONFIG_KEY_SCHEMA => array( + 'ruleID' => array( + 'columns' => array('ruleID'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/herald/storage/HeraldRule.php b/src/applications/herald/storage/HeraldRule.php --- a/src/applications/herald/storage/HeraldRule.php +++ b/src/applications/herald/storage/HeraldRule.php @@ -31,6 +31,33 @@ public function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text255', + 'contentType' => 'text255', + 'mustMatchAll' => 'bool', + 'configVersion' => 'uint32', + 'repetitionPolicy' => 'uint32', + 'ruleType' => 'text255', + 'isDisabled' => 'uint32', + 'triggerObjectPHID' => 'phid?', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_phid' => null, + 'phid' => array( + 'columns' => array('phid'), + 'unique' => true, + ), + 'authorPHID' => array( + 'columns' => array('authorPHID', 'name'), + 'unique' => true, + ), + 'IDX_RULE_TYPE' => array( + 'columns' => array('ruleType'), + ), + 'key_trigger' => array( + 'columns' => array('triggerObjectPHID'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/herald/storage/HeraldRuleEdit.php b/src/applications/herald/storage/HeraldRuleEdit.php --- a/src/applications/herald/storage/HeraldRuleEdit.php +++ b/src/applications/herald/storage/HeraldRuleEdit.php @@ -7,4 +7,18 @@ protected $ruleName; protected $action; + public function getConfiguration() { + return array( + self::CONFIG_COLUMN_SCHEMA => array( + 'ruleName' => 'text255', + 'action' => 'text32', + ), + self::CONFIG_KEY_SCHEMA => array( + 'ruleID' => array( + 'columns' => array('ruleID', 'dateCreated'), + ), + ), + ) + parent::getConfiguration(); + } + } diff --git a/src/applications/herald/storage/HeraldSchemaSpec.php b/src/applications/herald/storage/HeraldSchemaSpec.php new file mode 100644 --- /dev/null +++ b/src/applications/herald/storage/HeraldSchemaSpec.php @@ -0,0 +1,44 @@ +buildLiskSchemata('HeraldDAO'); + + $this->buildTransactionSchema( + new HeraldRuleTransaction(), + new HeraldRuleTransactionComment()); + + $this->buildRawSchema( + id(new HeraldRule())->getApplicationName(), + HeraldRule::TABLE_RULE_APPLIED, + array( + 'ruleID' => 'id', + 'phid' => 'phid', + ), + array( + 'PRIMARY' => array( + 'columns' => array('ruleID', 'phid'), + 'unique' => true, + ), + 'phid' => array( + 'columns' => array('phid'), + ), + )); + + $this->buildRawSchema( + id(new HeraldRule())->getApplicationName(), + HeraldTranscript::TABLE_SAVED_HEADER, + array( + 'phid' => 'phid', + 'header' => 'text', + ), + array( + 'PRIMARY' => array( + 'columns' => array('phid'), + 'unique' => true, + ), + )); + } + +} diff --git a/src/applications/herald/storage/transcript/HeraldApplyTranscript.php b/src/applications/herald/storage/transcript/HeraldApplyTranscript.php --- a/src/applications/herald/storage/transcript/HeraldApplyTranscript.php +++ b/src/applications/herald/storage/transcript/HeraldApplyTranscript.php @@ -1,17 +1,17 @@ setReason($effect->getReason()); $this->setApplied($applied); $this->setAppliedReason($reason); + } + public function setAction($action) { + $this->action = $action; + return $this; } public function getAction() { return $this->action; } + public function setTarget($target) { + $this->target = $target; + return $this; + } + public function getTarget() { return $this->target; } + public function setRuleID($rule_id) { + $this->ruleID = $rule_id; + return $this; + } + public function getRuleID() { return $this->ruleID; } + public function setEffector($effector) { + $this->effector = $effector; + return $this; + } + public function getEffector() { return $this->effector; } + public function setReason($reason) { + $this->reason = $reason; + return $this; + } + public function getReason() { return $this->reason; } + public function setApplied($applied) { + $this->applied = $applied; + return $this; + } + public function getApplied() { return $this->applied; } diff --git a/src/applications/herald/storage/transcript/HeraldTranscript.php b/src/applications/herald/storage/transcript/HeraldTranscript.php --- a/src/applications/herald/storage/transcript/HeraldTranscript.php +++ b/src/applications/herald/storage/transcript/HeraldTranscript.php @@ -100,6 +100,25 @@ 'conditionTranscripts' => true, 'applyTranscripts' => true, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'time' => 'epoch', + 'host' => 'text255', + 'duration' => 'double', + 'dryRun' => 'bool', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_phid' => null, + 'phid' => array( + 'columns' => array('phid'), + 'unique' => true, + ), + 'objectPHID' => array( + 'columns' => array('objectPHID'), + ), + 'garbageCollected' => array( + 'columns' => array('garbageCollected', 'time'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/owners/storage/PhabricatorOwnersOwner.php b/src/applications/owners/storage/PhabricatorOwnersOwner.php --- a/src/applications/owners/storage/PhabricatorOwnersOwner.php +++ b/src/applications/owners/storage/PhabricatorOwnersOwner.php @@ -12,6 +12,15 @@ public function getConfiguration() { return array( self::CONFIG_TIMESTAMPS => false, + self::CONFIG_KEY_SCHEMA => array( + 'packageID' => array( + 'columns' => array('packageID', 'userPHID'), + 'unique' => true, + ), + 'userPHID' => array( + 'columns' => array('userPHID'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/owners/storage/PhabricatorOwnersPackage.php b/src/applications/owners/storage/PhabricatorOwnersPackage.php --- a/src/applications/owners/storage/PhabricatorOwnersPackage.php +++ b/src/applications/owners/storage/PhabricatorOwnersPackage.php @@ -38,6 +38,24 @@ // This information is better available from the history table. self::CONFIG_TIMESTAMPS => false, self::CONFIG_AUX_PHID => true, + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text255', + 'originalName' => 'text255', + 'description' => 'text', + 'primaryOwnerPHID' => 'phid?', + 'auditingEnabled' => 'bool', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_phid' => null, + 'phid' => array( + 'columns' => array('phid'), + 'unique' => true, + ), + 'name' => array( + 'columns' => array('name'), + 'unique' => true, + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/owners/storage/PhabricatorOwnersPath.php b/src/applications/owners/storage/PhabricatorOwnersPath.php --- a/src/applications/owners/storage/PhabricatorOwnersPath.php +++ b/src/applications/owners/storage/PhabricatorOwnersPath.php @@ -10,6 +10,15 @@ public function getConfiguration() { return array( self::CONFIG_TIMESTAMPS => false, + self::CONFIG_COLUMN_SCHEMA => array( + 'path' => 'text255', + 'excluded' => 'bool', + ), + self::CONFIG_KEY_SCHEMA => array( + 'packageID' => array( + 'columns' => array('packageID'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/owners/storage/PhabricatorOwnersSchemaSpec.php b/src/applications/owners/storage/PhabricatorOwnersSchemaSpec.php new file mode 100644 --- /dev/null +++ b/src/applications/owners/storage/PhabricatorOwnersSchemaSpec.php @@ -0,0 +1,9 @@ +buildLiskSchemata('PhabricatorOwnersDAO'); + } + +}