From 502d18ede4003195d4585d3bbc11043e42d6f913 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 24 Sep 2014 13:50:57 -0700 Subject: [PATCH] Generate expected scheamta for Passphrase, Paste, Phlux, Phame Summary: Ref T1191. Nothing notable in these. Test Plan: Viewed web UI. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T1191 Differential Revision: https://secure.phabricator.com/D10528 --- src/__phutil_library_map__.php | 8 +++++++ .../storage/PassphraseCredential.php | 23 +++++++++++++++++++ .../storage/PassphraseSchemaSpec.php | 15 ++++++++++++ .../paste/storage/PhabricatorPaste.php | 20 ++++++++++++++++ .../storage/PhabricatorPasteSchemaSpec.php | 16 +++++++++++++ .../PhabricatorPasteTransactionComment.php | 9 ++++++++ src/applications/phame/storage/PhameBlog.php | 17 ++++++++++++++ src/applications/phame/storage/PhamePost.php | 21 +++++++++++++++++ .../phame/storage/PhameSchemaSpec.php | 11 +++++++++ .../phlux/storage/PhluxSchemaSpec.php | 11 +++++++++ .../phlux/storage/PhluxVariable.php | 9 ++++++++ 11 files changed, 160 insertions(+) create mode 100644 src/applications/passphrase/storage/PassphraseSchemaSpec.php create mode 100644 src/applications/paste/storage/PhabricatorPasteSchemaSpec.php create mode 100644 src/applications/phame/storage/PhameSchemaSpec.php create mode 100644 src/applications/phlux/storage/PhluxSchemaSpec.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 0b57d6b0aa..a8f81bc6f6 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1105,6 +1105,7 @@ phutil_register_library_map(array( 'PassphraseQueryConduitAPIMethod' => 'applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php', 'PassphraseRemarkupRule' => 'applications/passphrase/remarkup/PassphraseRemarkupRule.php', 'PassphraseSSHKey' => 'applications/passphrase/keys/PassphraseSSHKey.php', + 'PassphraseSchemaSpec' => 'applications/passphrase/storage/PassphraseSchemaSpec.php', 'PassphraseSecret' => 'applications/passphrase/storage/PassphraseSecret.php', 'PasteConduitAPIMethod' => 'applications/paste/conduit/PasteConduitAPIMethod.php', 'PasteCreateConduitAPIMethod' => 'applications/paste/conduit/PasteCreateConduitAPIMethod.php', @@ -1920,6 +1921,7 @@ phutil_register_library_map(array( 'PhabricatorPastePastePHIDType' => 'applications/paste/phid/PhabricatorPastePastePHIDType.php', 'PhabricatorPasteQuery' => 'applications/paste/query/PhabricatorPasteQuery.php', 'PhabricatorPasteRemarkupRule' => 'applications/paste/remarkup/PhabricatorPasteRemarkupRule.php', + 'PhabricatorPasteSchemaSpec' => 'applications/paste/storage/PhabricatorPasteSchemaSpec.php', 'PhabricatorPasteSearchEngine' => 'applications/paste/query/PhabricatorPasteSearchEngine.php', 'PhabricatorPasteTestDataGenerator' => 'applications/paste/lipsum/PhabricatorPasteTestDataGenerator.php', 'PhabricatorPasteTransaction' => 'applications/paste/storage/PhabricatorPasteTransaction.php', @@ -2493,11 +2495,13 @@ phutil_register_library_map(array( 'PhameQueryConduitAPIMethod' => 'applications/phame/conduit/PhameQueryConduitAPIMethod.php', 'PhameQueryPostsConduitAPIMethod' => 'applications/phame/conduit/PhameQueryPostsConduitAPIMethod.php', 'PhameResourceController' => 'applications/phame/controller/PhameResourceController.php', + 'PhameSchemaSpec' => 'applications/phame/storage/PhameSchemaSpec.php', 'PhameSkinSpecification' => 'applications/phame/skins/PhameSkinSpecification.php', 'PhluxController' => 'applications/phlux/controller/PhluxController.php', 'PhluxDAO' => 'applications/phlux/storage/PhluxDAO.php', 'PhluxEditController' => 'applications/phlux/controller/PhluxEditController.php', 'PhluxListController' => 'applications/phlux/controller/PhluxListController.php', + 'PhluxSchemaSpec' => 'applications/phlux/storage/PhluxSchemaSpec.php', 'PhluxTransaction' => 'applications/phlux/storage/PhluxTransaction.php', 'PhluxTransactionQuery' => 'applications/phlux/query/PhluxTransactionQuery.php', 'PhluxVariable' => 'applications/phlux/storage/PhluxVariable.php', @@ -4015,6 +4019,7 @@ phutil_register_library_map(array( 'PassphraseQueryConduitAPIMethod' => 'PassphraseConduitAPIMethod', 'PassphraseRemarkupRule' => 'PhabricatorObjectRemarkupRule', 'PassphraseSSHKey' => 'PassphraseAbstractKey', + 'PassphraseSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PassphraseSecret' => 'PassphraseDAO', 'PasteConduitAPIMethod' => 'ConduitAPIMethod', 'PasteCreateConduitAPIMethod' => 'PasteConduitAPIMethod', @@ -4861,6 +4866,7 @@ phutil_register_library_map(array( 'PhabricatorPastePastePHIDType' => 'PhabricatorPHIDType', 'PhabricatorPasteQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorPasteRemarkupRule' => 'PhabricatorObjectRemarkupRule', + 'PhabricatorPasteSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorPasteSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorPasteTestDataGenerator' => 'PhabricatorTestDataGenerator', 'PhabricatorPasteTransaction' => 'PhabricatorApplicationTransaction', @@ -5490,10 +5496,12 @@ phutil_register_library_map(array( 'PhameQueryConduitAPIMethod' => 'PhameConduitAPIMethod', 'PhameQueryPostsConduitAPIMethod' => 'PhameConduitAPIMethod', 'PhameResourceController' => 'CelerityResourceController', + 'PhameSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhluxController' => 'PhabricatorController', 'PhluxDAO' => 'PhabricatorLiskDAO', 'PhluxEditController' => 'PhluxController', 'PhluxListController' => 'PhluxController', + 'PhluxSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhluxTransaction' => 'PhabricatorApplicationTransaction', 'PhluxTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'PhluxVariable' => array( diff --git a/src/applications/passphrase/storage/PassphraseCredential.php b/src/applications/passphrase/storage/PassphraseCredential.php index 241da9ca41..641988714d 100644 --- a/src/applications/passphrase/storage/PassphraseCredential.php +++ b/src/applications/passphrase/storage/PassphraseCredential.php @@ -35,6 +35,29 @@ final class PassphraseCredential extends PassphraseDAO public function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text255', + 'credentialType' => 'text64', + 'providesType' => 'text64', + 'description' => 'text', + 'username' => 'text255', + 'secretID' => 'id?', + 'isDestroyed' => 'bool', + 'isLocked' => 'bool', + 'allowConduit' => 'bool', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_secret' => array( + 'columns' => array('secretID'), + 'unique' => true, + ), + 'key_type' => array( + 'columns' => array('credentialType'), + ), + 'key_provides' => array( + 'columns' => array('providesType'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/passphrase/storage/PassphraseSchemaSpec.php b/src/applications/passphrase/storage/PassphraseSchemaSpec.php new file mode 100644 index 0000000000..a3dbfd8328 --- /dev/null +++ b/src/applications/passphrase/storage/PassphraseSchemaSpec.php @@ -0,0 +1,15 @@ +buildLiskSchemata('PassphraseDAO'); + + $this->buildTransactionSchema( + new PassphraseCredentialTransaction()); + + $this->buildEdgeSchemata(new PassphraseCredential()); + } + +} diff --git a/src/applications/paste/storage/PhabricatorPaste.php b/src/applications/paste/storage/PhabricatorPaste.php index 4e5ac1332e..0b725c7a90 100644 --- a/src/applications/paste/storage/PhabricatorPaste.php +++ b/src/applications/paste/storage/PhabricatorPaste.php @@ -41,6 +41,26 @@ final class PhabricatorPaste extends PhabricatorPasteDAO public function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, + self::CONFIG_COLUMN_SCHEMA => array( + 'title' => 'text255', + 'language' => 'text64', + 'mailKey' => 'bytes20', + 'parentPHID' => 'phid?', + ), + self::CONFIG_KEY_SCHEMA => array( + 'parentPHID' => array( + 'columns' => array('parentPHID'), + ), + 'authorPHID' => array( + 'columns' => array('authorPHID'), + ), + 'key_dateCreated' => array( + 'columns' => array('dateCreated'), + ), + 'key_language' => array( + 'columns' => array('language'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/paste/storage/PhabricatorPasteSchemaSpec.php b/src/applications/paste/storage/PhabricatorPasteSchemaSpec.php new file mode 100644 index 0000000000..94df0246a3 --- /dev/null +++ b/src/applications/paste/storage/PhabricatorPasteSchemaSpec.php @@ -0,0 +1,16 @@ +buildLiskSchemata('PhabricatorPasteDAO'); + + $this->buildTransactionSchema( + new PhabricatorPasteTransaction(), + new PhabricatorPasteTransactionComment()); + + $this->buildEdgeSchemata(new PhabricatorPaste()); + } + +} diff --git a/src/applications/paste/storage/PhabricatorPasteTransactionComment.php b/src/applications/paste/storage/PhabricatorPasteTransactionComment.php index 145a375793..b50a9afc25 100644 --- a/src/applications/paste/storage/PhabricatorPasteTransactionComment.php +++ b/src/applications/paste/storage/PhabricatorPasteTransactionComment.php @@ -15,4 +15,13 @@ final class PhabricatorPasteTransactionComment return ($this->getTransactionPHID() != null); } + public function getConfiguration() { + $config = parent::getConfiguration(); + $config[self::CONFIG_COLUMN_SCHEMA] = array( + 'lineNumber' => 'uint32?', + 'lineLength' => 'uint32?', + ) + $config[self::CONFIG_COLUMN_SCHEMA]; + return $config; + } + } diff --git a/src/applications/phame/storage/PhameBlog.php b/src/applications/phame/storage/PhameBlog.php index b4c2d5a88a..beccfdc329 100644 --- a/src/applications/phame/storage/PhameBlog.php +++ b/src/applications/phame/storage/PhameBlog.php @@ -27,6 +27,23 @@ final class PhameBlog extends PhameDAO self::CONFIG_SERIALIZATION => array( 'configData' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text64', + 'description' => 'text', + 'domain' => 'text255?', + 'joinPolicy' => 'policy', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_phid' => null, + 'phid' => array( + 'columns' => array('phid'), + 'unique' => true, + ), + 'domain' => array( + 'columns' => array('domain'), + 'unique' => true, + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/phame/storage/PhamePost.php b/src/applications/phame/storage/PhamePost.php index a60b9d361c..bef665b7d6 100644 --- a/src/applications/phame/storage/PhamePost.php +++ b/src/applications/phame/storage/PhamePost.php @@ -88,6 +88,27 @@ final class PhamePost extends PhameDAO self::CONFIG_SERIALIZATION => array( 'configData' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'title' => 'text255', + 'phameTitle' => 'text64', + 'body' => 'text', + 'visibility' => 'uint32', + 'datePublished' => 'epoch?', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_phid' => null, + 'phid' => array( + 'columns' => array('phid'), + 'unique' => true, + ), + 'phameTitle' => array( + 'columns' => array('bloggerPHID', 'phameTitle'), + 'unique' => true, + ), + 'bloggerPosts' => array( + 'columns' => array('bloggerPHID', 'visibility', 'datePublished'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/phame/storage/PhameSchemaSpec.php b/src/applications/phame/storage/PhameSchemaSpec.php new file mode 100644 index 0000000000..7897316bf2 --- /dev/null +++ b/src/applications/phame/storage/PhameSchemaSpec.php @@ -0,0 +1,11 @@ +buildLiskSchemata('PhameDAO'); + $this->buildEdgeSchemata(new PhameBlog()); + } + +} diff --git a/src/applications/phlux/storage/PhluxSchemaSpec.php b/src/applications/phlux/storage/PhluxSchemaSpec.php new file mode 100644 index 0000000000..b243d94fe1 --- /dev/null +++ b/src/applications/phlux/storage/PhluxSchemaSpec.php @@ -0,0 +1,11 @@ +buildLiskSchemata('PhluxDAO'); + $this->buildTransactionSchema(new PhluxTransaction()); + } + +} diff --git a/src/applications/phlux/storage/PhluxVariable.php b/src/applications/phlux/storage/PhluxVariable.php index 88aa3ac22a..23a0ffcc82 100644 --- a/src/applications/phlux/storage/PhluxVariable.php +++ b/src/applications/phlux/storage/PhluxVariable.php @@ -16,6 +16,15 @@ final class PhluxVariable extends PhluxDAO self::CONFIG_SERIALIZATION => array( 'variableValue' => self::SERIALIZATION_JSON ), + self::CONFIG_COLUMN_SCHEMA => array( + 'variableKey' => 'text64', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_key' => array( + 'columns' => array('variableKey'), + 'unique' => true, + ), + ), ) + parent::getConfiguration(); }