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 @@ -710,7 +710,6 @@ 'HarbormasterBuildPlanQuery' => 'applications/harbormaster/query/HarbormasterBuildPlanQuery.php', 'HarbormasterBuildPlanSearchEngine' => 'applications/harbormaster/query/HarbormasterBuildPlanSearchEngine.php', 'HarbormasterBuildPlanTransaction' => 'applications/harbormaster/storage/configuration/HarbormasterBuildPlanTransaction.php', - 'HarbormasterBuildPlanTransactionComment' => 'applications/harbormaster/storage/configuration/HarbormasterBuildPlanTransactionComment.php', 'HarbormasterBuildPlanTransactionQuery' => 'applications/harbormaster/query/HarbormasterBuildPlanTransactionQuery.php', 'HarbormasterBuildQuery' => 'applications/harbormaster/query/HarbormasterBuildQuery.php', 'HarbormasterBuildStep' => 'applications/harbormaster/storage/configuration/HarbormasterBuildStep.php', @@ -762,6 +761,7 @@ 'HarbormasterQueryBuildablesConduitAPIMethod' => 'applications/harbormaster/conduit/HarbormasterQueryBuildablesConduitAPIMethod.php', 'HarbormasterQueryBuildsConduitAPIMethod' => 'applications/harbormaster/conduit/HarbormasterQueryBuildsConduitAPIMethod.php', 'HarbormasterRemarkupRule' => 'applications/harbormaster/remarkup/HarbormasterRemarkupRule.php', + 'HarbormasterSchemaSpec' => 'applications/harbormaster/storage/HarbormasterSchemaSpec.php', 'HarbormasterScratchTable' => 'applications/harbormaster/storage/HarbormasterScratchTable.php', 'HarbormasterSendMessageConduitAPIMethod' => 'applications/harbormaster/conduit/HarbormasterSendMessageConduitAPIMethod.php', 'HarbormasterSleepBuildStepImplementation' => 'applications/harbormaster/step/HarbormasterSleepBuildStepImplementation.php', @@ -3585,7 +3585,6 @@ 'HarbormasterBuildPlanQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'HarbormasterBuildPlanSearchEngine' => 'PhabricatorApplicationSearchEngine', 'HarbormasterBuildPlanTransaction' => 'PhabricatorApplicationTransaction', - 'HarbormasterBuildPlanTransactionComment' => 'PhabricatorApplicationTransactionComment', 'HarbormasterBuildPlanTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'HarbormasterBuildQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'HarbormasterBuildStep' => array( @@ -3649,6 +3648,7 @@ 'HarbormasterQueryBuildablesConduitAPIMethod' => 'HarbormasterConduitAPIMethod', 'HarbormasterQueryBuildsConduitAPIMethod' => 'HarbormasterConduitAPIMethod', 'HarbormasterRemarkupRule' => 'PhabricatorObjectRemarkupRule', + 'HarbormasterSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'HarbormasterScratchTable' => 'HarbormasterDAO', 'HarbormasterSendMessageConduitAPIMethod' => 'HarbormasterConduitAPIMethod', 'HarbormasterSleepBuildStepImplementation' => 'HarbormasterBuildStepImplementation', 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 @@ -42,6 +42,9 @@ ->loadObjects(); foreach ($objects as $object) { + if ($object->getConfigOption(LiskDAO::CONFIG_NO_TABLE)) { + continue; + } $this->buildLiskObjectSchema($object); } } diff --git a/src/applications/harbormaster/storage/HarbormasterBuildCommand.php b/src/applications/harbormaster/storage/HarbormasterBuildCommand.php --- a/src/applications/harbormaster/storage/HarbormasterBuildCommand.php +++ b/src/applications/harbormaster/storage/HarbormasterBuildCommand.php @@ -10,4 +10,17 @@ protected $targetPHID; protected $command; + public function getConfiguration() { + return array( + self::CONFIG_COLUMN_SCHEMA => array( + 'command' => 'text128', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_target' => array( + 'columns' => array('targetPHID'), + ), + ), + ) + parent::getConfiguration(); + } + } diff --git a/src/applications/harbormaster/storage/HarbormasterBuildMessage.php b/src/applications/harbormaster/storage/HarbormasterBuildMessage.php --- a/src/applications/harbormaster/storage/HarbormasterBuildMessage.php +++ b/src/applications/harbormaster/storage/HarbormasterBuildMessage.php @@ -22,6 +22,20 @@ ->setIsConsumed(0); } + public function getConfiguration() { + return array( + self::CONFIG_COLUMN_SCHEMA => array( + 'type' => 'text16', + 'isConsumed' => 'bool', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_buildtarget' => array( + 'columns' => array('buildTargetPHID'), + ), + ), + ) + parent::getConfiguration(); + } + public function getBuildTarget() { return $this->assertAttached($this->buildTarget); } diff --git a/src/applications/harbormaster/storage/HarbormasterBuildable.php b/src/applications/harbormaster/storage/HarbormasterBuildable.php --- a/src/applications/harbormaster/storage/HarbormasterBuildable.php +++ b/src/applications/harbormaster/storage/HarbormasterBuildable.php @@ -155,6 +155,22 @@ public function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, + self::CONFIG_COLUMN_SCHEMA => array( + 'containerPHID' => 'phid?', + 'buildableStatus' => 'text32', + 'isManualBuildable' => 'bool', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_buildable' => array( + 'columns' => array('buildablePHID'), + ), + 'key_container' => array( + 'columns' => array('containerPHID'), + ), + 'key_manual' => array( + 'columns' => array('isManualBuildable'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/harbormaster/storage/HarbormasterObject.php b/src/applications/harbormaster/storage/HarbormasterObject.php --- a/src/applications/harbormaster/storage/HarbormasterObject.php +++ b/src/applications/harbormaster/storage/HarbormasterObject.php @@ -2,12 +2,14 @@ final class HarbormasterObject extends HarbormasterDAO { - protected $phid; protected $name; public function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text255', + ), ) + parent::getConfiguration(); } diff --git a/src/applications/harbormaster/storage/HarbormasterSchemaSpec.php b/src/applications/harbormaster/storage/HarbormasterSchemaSpec.php new file mode 100644 --- /dev/null +++ b/src/applications/harbormaster/storage/HarbormasterSchemaSpec.php @@ -0,0 +1,45 @@ +buildLiskSchemata('HarbormasterDAO'); + + $this->buildEdgeSchemata(new HarbormasterBuildable()); + $this->buildCounterSchema(new HarbormasterBuildable()); + + $this->buildTransactionSchema( + new HarbormasterBuildableTransaction()); + + $this->buildTransactionSchema( + new HarbormasterBuildTransaction()); + + $this->buildTransactionSchema( + new HarbormasterBuildPlanTransaction()); + + $this->buildTransactionSchema( + new HarbormasterBuildStepTransaction()); + + $this->buildRawSchema( + id(new HarbormasterBuildable())->getApplicationName(), + 'harbormaster_buildlogchunk', + array( + 'id' => 'id', + 'logID' => 'id', + 'encoding' => 'text32', + 'size' => 'uint32', + 'chunk' => 'bytes', + ), + array( + 'PRIMARY' => array( + 'columns' => array('id'), + 'unique' => true, + ), + 'key_log' => array( + 'columns' => array('logID'), + ), + )); + + } + +} diff --git a/src/applications/harbormaster/storage/HarbormasterScratchTable.php b/src/applications/harbormaster/storage/HarbormasterScratchTable.php --- a/src/applications/harbormaster/storage/HarbormasterScratchTable.php +++ b/src/applications/harbormaster/storage/HarbormasterScratchTable.php @@ -11,4 +11,18 @@ protected $data; protected $bigData; + public function getConfiguration() { + return array( + self::CONFIG_COLUMN_SCHEMA => array( + 'data' => 'text64', + 'bigData' => 'text?', + ), + self::CONFIG_KEY_SCHEMA => array( + 'data' => array( + 'columns' => array('data'), + ), + ), + ) + parent::getConfiguration(); + } + } diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuild.php b/src/applications/harbormaster/storage/build/HarbormasterBuild.php --- a/src/applications/harbormaster/storage/build/HarbormasterBuild.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuild.php @@ -143,6 +143,21 @@ public function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, + self::CONFIG_COLUMN_SCHEMA => array( + 'buildStatus' => 'text32', + 'buildGeneration' => 'uint32', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_buildable' => array( + 'columns' => array('buildablePHID'), + ), + 'key_plan' => array( + 'columns' => array('buildPlanPHID'), + ), + 'key_status' => array( + 'columns' => array('buildStatus'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php b/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php --- a/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php @@ -26,6 +26,20 @@ self::CONFIG_SERIALIZATION => array( 'artifactData' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'artifactType' => 'text32', + 'artifactIndex' => 'bytes12', + 'artifactKey' => 'text255', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_artifact' => array( + 'columns' => array('artifactType', 'artifactIndex'), + 'unique' => true, + ), + 'key_garbagecollect' => array( + 'columns' => array('artifactType', 'dateCreated'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuildItem.php b/src/applications/harbormaster/storage/build/HarbormasterBuildItem.php --- a/src/applications/harbormaster/storage/build/HarbormasterBuildItem.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuildItem.php @@ -7,6 +7,7 @@ public function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, + self::CONFIG_NO_TABLE => true, ) + parent::getConfiguration(); } diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php b/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php --- a/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php @@ -30,6 +30,17 @@ public function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, + self::CONFIG_COLUMN_SCHEMA => array( + 'logSource' => 'text255', + 'logType' => 'text255', + 'duration' => 'uint32', + 'live' => 'bool', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_buildtarget' => array( + 'columns' => array('buildTargetPHID'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php b/src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php --- a/src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php +++ b/src/applications/harbormaster/storage/build/HarbormasterBuildTarget.php @@ -99,7 +99,20 @@ self::CONFIG_SERIALIZATION => array( 'details' => self::SERIALIZATION_JSON, 'variables' => self::SERIALIZATION_JSON, - ) + ), + self::CONFIG_COLUMN_SCHEMA => array( + 'className' => 'text255', + 'targetStatus' => 'text64', + 'name' => 'text255', + 'dateStarted' => 'epoch?', + 'dateCompleted' => 'epoch?', + 'buildGeneration' => 'uint32', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_build' => array( + 'columns' => array('buildPHID', 'buildStepPHID'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/harbormaster/storage/configuration/HarbormasterBuildPlan.php b/src/applications/harbormaster/storage/configuration/HarbormasterBuildPlan.php --- a/src/applications/harbormaster/storage/configuration/HarbormasterBuildPlan.php +++ b/src/applications/harbormaster/storage/configuration/HarbormasterBuildPlan.php @@ -21,6 +21,15 @@ public function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text255', + 'planStatus' => 'text32', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_status' => array( + 'columns' => array('planStatus'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/harbormaster/storage/configuration/HarbormasterBuildPlanTransaction.php b/src/applications/harbormaster/storage/configuration/HarbormasterBuildPlanTransaction.php --- a/src/applications/harbormaster/storage/configuration/HarbormasterBuildPlanTransaction.php +++ b/src/applications/harbormaster/storage/configuration/HarbormasterBuildPlanTransaction.php @@ -14,10 +14,6 @@ return HarbormasterBuildPlanPHIDType::TYPECONST; } - public function getApplicationTransactionCommentObject() { - return new HarbormasterBuildPlanTransactionComment(); - } - public function getIcon() { $old = $this->getOldValue(); $new = $this->getNewValue(); diff --git a/src/applications/harbormaster/storage/configuration/HarbormasterBuildPlanTransactionComment.php b/src/applications/harbormaster/storage/configuration/HarbormasterBuildPlanTransactionComment.php deleted file mode 100644 --- a/src/applications/harbormaster/storage/configuration/HarbormasterBuildPlanTransactionComment.php +++ /dev/null @@ -1,10 +0,0 @@ - true, self::CONFIG_SERIALIZATION => array( 'details' => self::SERIALIZATION_JSON, - ) + ), + self::CONFIG_COLUMN_SCHEMA => array( + 'className' => 'text255', + 'sequence' => 'uint32', + 'name' => 'text255', + 'description' => 'text', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_plan' => array( + 'columns' => array('buildPlanPHID'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/tokens/storage/PhabricatorToken.php b/src/applications/tokens/storage/PhabricatorToken.php --- a/src/applications/tokens/storage/PhabricatorToken.php +++ b/src/applications/tokens/storage/PhabricatorToken.php @@ -10,6 +10,7 @@ public function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, + self::CONFIG_NO_TABLE => true, ) + parent::getConfiguration(); } diff --git a/src/infrastructure/storage/lisk/LiskDAO.php b/src/infrastructure/storage/lisk/LiskDAO.php --- a/src/infrastructure/storage/lisk/LiskDAO.php +++ b/src/infrastructure/storage/lisk/LiskDAO.php @@ -171,6 +171,7 @@ const CONFIG_BINARY = 'binary'; const CONFIG_COLUMN_SCHEMA = 'col-schema'; const CONFIG_KEY_SCHEMA = 'key-schema'; + const CONFIG_NO_TABLE = 'no-table'; const SERIALIZATION_NONE = 'id'; const SERIALIZATION_JSON = 'json'; @@ -351,6 +352,10 @@ * CONFIG_KEY_SCHEMA * Provide a map of key names to key specifications. * + * CONFIG_NO_TABLE + * Allows you to specify that this object does not actually have a table in + * the database. + * * @return dictionary Map of configuration options to values. * * @task config