From cfbcd69e9b747f0d68e8fe03a9f388e1cab3ce6e Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 1 Oct 2014 07:52:26 -0700 Subject: [PATCH] Generate expected schemata for Pholio, Phortune, Phragment, Phriction and Policy Summary: Ref T1191. Nothing too out-of-the-ordinary here. Test Plan: Saw fewer than 500 remaining issues. Reviewers: btrahan Reviewed By: btrahan Subscribers: chad, epriestley, hach-que Maniphest Tasks: T1191 Differential Revision: https://secure.phabricator.com/D10587 --- src/__phutil_library_map__.php | 12 +++++++++ .../pholio/storage/PholioImage.php | 18 +++++++++++++ .../pholio/storage/PholioMock.php | 17 ++++++++++++ .../pholio/storage/PholioSchemaSpec.php | 15 +++++++++++ .../storage/PholioTransactionComment.php | 20 ++++++++++++++ .../phortune/storage/PhortuneAccount.php | 4 +++ .../phortune/storage/PhortuneCart.php | 8 ++++++ .../phortune/storage/PhortuneCharge.php | 14 ++++++++++ .../storage/PhortunePaymentMethod.php | 14 ++++++++++ .../phortune/storage/PhortuneProduct.php | 13 ++++++++++ .../phortune/storage/PhortunePurchase.php | 12 +++++++++ .../phortune/storage/PhortuneSchemaSpec.php | 17 ++++++++++++ .../phragment/storage/PhragmentFragment.php | 11 ++++++++ .../storage/PhragmentFragmentVersion.php | 10 +++++++ .../phragment/storage/PhragmentSchemaSpec.php | 11 ++++++++ .../phragment/storage/PhragmentSnapshot.php | 9 +++++++ .../storage/PhragmentSnapshotChild.php | 18 +++++++++++++ .../phrequent/storage/PhrequentSchemaSpec.php | 9 +++++++ .../phrequent/storage/PhrequentUserTime.php | 11 ++++++++ .../phriction/storage/PhrictionContent.php | 26 +++++++++++++++++++ .../phriction/storage/PhrictionDocument.php | 21 +++++++++++++++ .../phriction/storage/PhrictionSchemaSpec.php | 11 ++++++++ .../policy/storage/PhabricatorPolicy.php | 10 +++++++ .../storage/PhabricatorPolicySchemaSpec.php | 9 +++++++ 24 files changed, 320 insertions(+) create mode 100644 src/applications/pholio/storage/PholioSchemaSpec.php create mode 100644 src/applications/phortune/storage/PhortuneSchemaSpec.php create mode 100644 src/applications/phragment/storage/PhragmentSchemaSpec.php create mode 100644 src/applications/phrequent/storage/PhrequentSchemaSpec.php create mode 100644 src/applications/phriction/storage/PhrictionSchemaSpec.php create mode 100644 src/applications/policy/storage/PhabricatorPolicySchemaSpec.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 1f89c6d8af..352ac67102 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -2000,6 +2000,7 @@ phutil_register_library_map(array( 'PhabricatorPolicyRuleLunarPhase' => 'applications/policy/rule/PhabricatorPolicyRuleLunarPhase.php', 'PhabricatorPolicyRuleProjects' => 'applications/policy/rule/PhabricatorPolicyRuleProjects.php', 'PhabricatorPolicyRuleUsers' => 'applications/policy/rule/PhabricatorPolicyRuleUsers.php', + 'PhabricatorPolicySchemaSpec' => 'applications/policy/storage/PhabricatorPolicySchemaSpec.php', 'PhabricatorPolicyTestCase' => 'applications/policy/__tests__/PhabricatorPolicyTestCase.php', 'PhabricatorPolicyTestObject' => 'applications/policy/__tests__/PhabricatorPolicyTestObject.php', 'PhabricatorPolicyType' => 'applications/policy/constants/PhabricatorPolicyType.php', @@ -2541,6 +2542,7 @@ phutil_register_library_map(array( 'PholioMockViewController' => 'applications/pholio/controller/PholioMockViewController.php', 'PholioRemarkupRule' => 'applications/pholio/remarkup/PholioRemarkupRule.php', 'PholioReplyHandler' => 'applications/pholio/mail/PholioReplyHandler.php', + 'PholioSchemaSpec' => 'applications/pholio/storage/PholioSchemaSpec.php', 'PholioSearchIndexer' => 'applications/pholio/search/PholioSearchIndexer.php', 'PholioTransaction' => 'applications/pholio/storage/PholioTransaction.php', 'PholioTransactionComment' => 'applications/pholio/storage/PholioTransactionComment.php', @@ -2595,6 +2597,7 @@ phutil_register_library_map(array( 'PhortunePurchase' => 'applications/phortune/storage/PhortunePurchase.php', 'PhortunePurchaseQuery' => 'applications/phortune/query/PhortunePurchaseQuery.php', 'PhortunePurchaseViewController' => 'applications/phortune/controller/PhortunePurchaseViewController.php', + 'PhortuneSchemaSpec' => 'applications/phortune/storage/PhortuneSchemaSpec.php', 'PhortuneStripePaymentProvider' => 'applications/phortune/provider/PhortuneStripePaymentProvider.php', 'PhortuneTestExtraPaymentProvider' => 'applications/phortune/provider/__tests__/PhortuneTestExtraPaymentProvider.php', 'PhortuneTestPaymentProvider' => 'applications/phortune/provider/PhortuneTestPaymentProvider.php', @@ -2618,6 +2621,7 @@ phutil_register_library_map(array( 'PhragmentPolicyController' => 'applications/phragment/controller/PhragmentPolicyController.php', 'PhragmentQueryFragmentsConduitAPIMethod' => 'applications/phragment/conduit/PhragmentQueryFragmentsConduitAPIMethod.php', 'PhragmentRevertController' => 'applications/phragment/controller/PhragmentRevertController.php', + 'PhragmentSchemaSpec' => 'applications/phragment/storage/PhragmentSchemaSpec.php', 'PhragmentSnapshot' => 'applications/phragment/storage/PhragmentSnapshot.php', 'PhragmentSnapshotChild' => 'applications/phragment/storage/PhragmentSnapshotChild.php', 'PhragmentSnapshotChildQuery' => 'applications/phragment/query/PhragmentSnapshotChildQuery.php', @@ -2636,6 +2640,7 @@ phutil_register_library_map(array( 'PhrequentListController' => 'applications/phrequent/controller/PhrequentListController.php', 'PhrequentPopConduitAPIMethod' => 'applications/phrequent/conduit/PhrequentPopConduitAPIMethod.php', 'PhrequentPushConduitAPIMethod' => 'applications/phrequent/conduit/PhrequentPushConduitAPIMethod.php', + 'PhrequentSchemaSpec' => 'applications/phrequent/storage/PhrequentSchemaSpec.php', 'PhrequentSearchEngine' => 'applications/phrequent/query/PhrequentSearchEngine.php', 'PhrequentTimeBlock' => 'applications/phrequent/storage/PhrequentTimeBlock.php', 'PhrequentTimeBlockTestCase' => 'applications/phrequent/storage/__tests__/PhrequentTimeBlockTestCase.php', @@ -2674,6 +2679,7 @@ phutil_register_library_map(array( 'PhrictionMoveController' => 'applications/phriction/controller/PhrictionMoveController.php', 'PhrictionNewController' => 'applications/phriction/controller/PhrictionNewController.php', 'PhrictionRemarkupRule' => 'applications/phriction/markup/PhrictionRemarkupRule.php', + 'PhrictionSchemaSpec' => 'applications/phriction/storage/PhrictionSchemaSpec.php', 'PhrictionSearchEngine' => 'applications/phriction/query/PhrictionSearchEngine.php', 'PhrictionSearchIndexer' => 'applications/phriction/search/PhrictionSearchIndexer.php', 'PonderAddAnswerView' => 'applications/ponder/view/PonderAddAnswerView.php', @@ -4951,6 +4957,7 @@ phutil_register_library_map(array( 'PhabricatorPolicyRuleLunarPhase' => 'PhabricatorPolicyRule', 'PhabricatorPolicyRuleProjects' => 'PhabricatorPolicyRule', 'PhabricatorPolicyRuleUsers' => 'PhabricatorPolicyRule', + 'PhabricatorPolicySchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorPolicyTestCase' => 'PhabricatorTestCase', 'PhabricatorPolicyTestObject' => 'PhabricatorPolicyInterface', 'PhabricatorPolicyType' => 'PhabricatorPolicyConstants', @@ -5564,6 +5571,7 @@ phutil_register_library_map(array( 'PholioMockViewController' => 'PholioController', 'PholioRemarkupRule' => 'PhabricatorObjectRemarkupRule', 'PholioReplyHandler' => 'PhabricatorMailReplyHandler', + 'PholioSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PholioSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PholioTransaction' => 'PhabricatorApplicationTransaction', 'PholioTransactionComment' => 'PhabricatorApplicationTransactionComment', @@ -5633,6 +5641,7 @@ phutil_register_library_map(array( ), 'PhortunePurchaseQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhortunePurchaseViewController' => 'PhortuneController', + 'PhortuneSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhortuneStripePaymentProvider' => 'PhortunePaymentProvider', 'PhortuneTestExtraPaymentProvider' => 'PhortunePaymentProvider', 'PhortuneTestPaymentProvider' => 'PhortunePaymentProvider', @@ -5662,6 +5671,7 @@ phutil_register_library_map(array( 'PhragmentPolicyController' => 'PhragmentController', 'PhragmentQueryFragmentsConduitAPIMethod' => 'PhragmentConduitAPIMethod', 'PhragmentRevertController' => 'PhragmentController', + 'PhragmentSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhragmentSnapshot' => array( 'PhragmentDAO', 'PhabricatorPolicyInterface', @@ -5686,6 +5696,7 @@ phutil_register_library_map(array( 'PhrequentListController' => 'PhrequentController', 'PhrequentPopConduitAPIMethod' => 'PhrequentConduitAPIMethod', 'PhrequentPushConduitAPIMethod' => 'PhrequentConduitAPIMethod', + 'PhrequentSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhrequentSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhrequentTimeBlock' => 'Phobject', 'PhrequentTimeBlockTestCase' => 'PhabricatorTestCase', @@ -5735,6 +5746,7 @@ phutil_register_library_map(array( 'PhrictionMoveController' => 'PhrictionController', 'PhrictionNewController' => 'PhrictionController', 'PhrictionRemarkupRule' => 'PhutilRemarkupRule', + 'PhrictionSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhrictionSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhrictionSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PonderAddAnswerView' => 'AphrontView', diff --git a/src/applications/pholio/storage/PholioImage.php b/src/applications/pholio/storage/PholioImage.php index ccb17246b0..047b22bcbd 100644 --- a/src/applications/pholio/storage/PholioImage.php +++ b/src/applications/pholio/storage/PholioImage.php @@ -22,6 +22,24 @@ final class PholioImage extends PholioDAO public function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, + self::CONFIG_COLUMN_SCHEMA => array( + 'mockID' => 'id?', + 'name' => 'text128', + 'description' => 'text', + 'sequence' => 'uint32', + 'isObsolete' => 'bool', + 'replacesImagePHID' => 'phid?', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_phid' => null, + 'keyPHID' => array( + 'columns' => array('phid'), + 'unique' => true, + ), + 'mockID' => array( + 'columns' => array('mockID', 'isObsolete', 'sequence'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/pholio/storage/PholioMock.php b/src/applications/pholio/storage/PholioMock.php index 028af28f4c..e4a574d480 100644 --- a/src/applications/pholio/storage/PholioMock.php +++ b/src/applications/pholio/storage/PholioMock.php @@ -52,6 +52,23 @@ final class PholioMock extends PholioDAO public function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text128', + 'description' => 'text', + 'originalName' => 'text128', + 'mailKey' => 'bytes20', + 'status' => 'text12', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_phid' => null, + 'phid' => array( + 'columns' => array('phid'), + 'unique' => true, + ), + 'authorPHID' => array( + 'columns' => array('authorPHID'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/pholio/storage/PholioSchemaSpec.php b/src/applications/pholio/storage/PholioSchemaSpec.php new file mode 100644 index 0000000000..d84e9d4774 --- /dev/null +++ b/src/applications/pholio/storage/PholioSchemaSpec.php @@ -0,0 +1,15 @@ +buildLiskSchemata('PholioDAO'); + + $this->buildEdgeSchemata(new PholioMock()); + + $this->buildTransactionSchema( + new PholioTransaction(), + new PholioTransactionComment()); + } + +} diff --git a/src/applications/pholio/storage/PholioTransactionComment.php b/src/applications/pholio/storage/PholioTransactionComment.php index dcb3d810dc..d5693e8a90 100644 --- a/src/applications/pholio/storage/PholioTransactionComment.php +++ b/src/applications/pholio/storage/PholioTransactionComment.php @@ -14,6 +14,26 @@ final class PholioTransactionComment return new PholioTransaction(); } + public function getConfiguration() { + $config = parent::getConfiguration(); + + $config[self::CONFIG_COLUMN_SCHEMA] = array( + 'imageID' => 'id?', + 'x' => 'uint32?', + 'y' => 'uint32?', + 'width' => 'uint32?', + 'height' => 'uint32?', + ) + $config[self::CONFIG_COLUMN_SCHEMA]; + + $config[self::CONFIG_KEY_SCHEMA] = array( + 'key_draft' => array( + 'columns' => array('authorPHID', 'imageID', 'transactionPHID'), + ), + ) + $config[self::CONFIG_KEY_SCHEMA]; + + return $config; + } + public function toDictionary() { return array( 'id' => $this->getID(), diff --git a/src/applications/phortune/storage/PhortuneAccount.php b/src/applications/phortune/storage/PhortuneAccount.php index 8eff081370..0cc6723a3f 100644 --- a/src/applications/phortune/storage/PhortuneAccount.php +++ b/src/applications/phortune/storage/PhortuneAccount.php @@ -17,6 +17,10 @@ final class PhortuneAccount extends PhortuneDAO public function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text255', + 'balanceInCents' => 'sint64', + ), ) + parent::getConfiguration(); } diff --git a/src/applications/phortune/storage/PhortuneCart.php b/src/applications/phortune/storage/PhortuneCart.php index eee9668bc0..28e6d90a0d 100644 --- a/src/applications/phortune/storage/PhortuneCart.php +++ b/src/applications/phortune/storage/PhortuneCart.php @@ -21,6 +21,14 @@ final class PhortuneCart extends PhortuneDAO self::CONFIG_SERIALIZATION => array( 'metadata' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'status' => 'text32', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_account' => array( + 'columns' => array('accountPHID'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/phortune/storage/PhortuneCharge.php b/src/applications/phortune/storage/PhortuneCharge.php index 15f55363b3..48ccb93963 100644 --- a/src/applications/phortune/storage/PhortuneCharge.php +++ b/src/applications/phortune/storage/PhortuneCharge.php @@ -33,6 +33,20 @@ final class PhortuneCharge extends PhortuneDAO self::CONFIG_SERIALIZATION => array( 'metadata' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'paymentProviderKey' => 'text128', + 'paymentMethodPHID' => 'phid?', + 'amountInCents' => 'sint32', + 'status' => 'text32', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_cart' => array( + 'columns' => array('cartPHID'), + ), + 'key_account' => array( + 'columns' => array('accountPHID'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/phortune/storage/PhortunePaymentMethod.php b/src/applications/phortune/storage/PhortunePaymentMethod.php index bb6cffadb5..f23f770eb7 100644 --- a/src/applications/phortune/storage/PhortunePaymentMethod.php +++ b/src/applications/phortune/storage/PhortunePaymentMethod.php @@ -29,6 +29,20 @@ final class PhortunePaymentMethod extends PhortuneDAO self::CONFIG_SERIALIZATION => array( 'metadata' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text255', + 'status' => 'text64', + 'brand' => 'text64', + 'expires' => 'text16', + 'providerType' => 'text16', + 'providerDomain' => 'text64', + 'lastFourDigits' => 'text16', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_account' => array( + 'columns' => array('accountPHID', 'status'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/phortune/storage/PhortuneProduct.php b/src/applications/phortune/storage/PhortuneProduct.php index 716ae93486..2ac3a4ef30 100644 --- a/src/applications/phortune/storage/PhortuneProduct.php +++ b/src/applications/phortune/storage/PhortuneProduct.php @@ -27,6 +27,19 @@ final class PhortuneProduct extends PhortuneDAO self::CONFIG_SERIALIZATION => array( 'metadata' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'productName' => 'text255', + 'productType' => 'text64', + 'status' => 'text64', + 'priceInCents' => 'sint64', + 'billingIntervalInMonths' => 'uint32?', + 'trialPeriodInDays' => 'uint32?', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_status' => array( + 'columns' => array('status'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/phortune/storage/PhortunePurchase.php b/src/applications/phortune/storage/PhortunePurchase.php index ddad23fd61..26db7e2aba 100644 --- a/src/applications/phortune/storage/PhortunePurchase.php +++ b/src/applications/phortune/storage/PhortunePurchase.php @@ -31,6 +31,18 @@ final class PhortunePurchase extends PhortuneDAO self::CONFIG_SERIALIZATION => array( 'metadata' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'cartPHID' => 'phid?', + 'basePriceInCents' => 'sint32', + 'quantity' => 'uint32', + 'totalPriceInCents' => 'sint32', + 'status' => 'text32', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_cart' => array( + 'columns' => array('cartPHID'), + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/phortune/storage/PhortuneSchemaSpec.php b/src/applications/phortune/storage/PhortuneSchemaSpec.php new file mode 100644 index 0000000000..2289d7bd04 --- /dev/null +++ b/src/applications/phortune/storage/PhortuneSchemaSpec.php @@ -0,0 +1,17 @@ +buildLiskSchemata('PhortuneDAO'); + + $this->buildEdgeSchemata(new PhortuneAccount()); + + $this->buildTransactionSchema( + new PhortuneAccountTransaction()); + + $this->buildTransactionSchema( + new PhortuneProductTransaction()); + } + +} diff --git a/src/applications/phragment/storage/PhragmentFragment.php b/src/applications/phragment/storage/PhragmentFragment.php index 6d8b3f803c..9ff3b769d1 100644 --- a/src/applications/phragment/storage/PhragmentFragment.php +++ b/src/applications/phragment/storage/PhragmentFragment.php @@ -14,6 +14,17 @@ final class PhragmentFragment extends PhragmentDAO public function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, + self::CONFIG_COLUMN_SCHEMA => array( + 'path' => 'text255', + 'depth' => 'uint32', + 'latestVersionPHID' => 'phid?', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_path' => array( + 'columns' => array('path'), + 'unique' => true, + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/phragment/storage/PhragmentFragmentVersion.php b/src/applications/phragment/storage/PhragmentFragmentVersion.php index 79a8a6eee5..9085598314 100644 --- a/src/applications/phragment/storage/PhragmentFragmentVersion.php +++ b/src/applications/phragment/storage/PhragmentFragmentVersion.php @@ -13,6 +13,16 @@ final class PhragmentFragmentVersion extends PhragmentDAO public function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, + self::CONFIG_COLUMN_SCHEMA => array( + 'sequence' => 'uint32', + 'filePHID' => 'phid?', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_version' => array( + 'columns' => array('fragmentPHID', 'sequence'), + 'unique' => true, + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/phragment/storage/PhragmentSchemaSpec.php b/src/applications/phragment/storage/PhragmentSchemaSpec.php new file mode 100644 index 0000000000..5e6117c3ee --- /dev/null +++ b/src/applications/phragment/storage/PhragmentSchemaSpec.php @@ -0,0 +1,11 @@ +buildLiskSchemata('PhragmentDAO'); + + $this->buildEdgeSchemata(new PhragmentFragment()); + } + +} diff --git a/src/applications/phragment/storage/PhragmentSnapshot.php b/src/applications/phragment/storage/PhragmentSnapshot.php index a228341ce0..be6f36c639 100644 --- a/src/applications/phragment/storage/PhragmentSnapshot.php +++ b/src/applications/phragment/storage/PhragmentSnapshot.php @@ -11,6 +11,15 @@ final class PhragmentSnapshot extends PhragmentDAO public function getConfiguration() { return array( self::CONFIG_AUX_PHID => true, + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text255', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_name' => array( + 'columns' => array('primaryFragmentPHID', 'name'), + 'unique' => true, + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/phragment/storage/PhragmentSnapshotChild.php b/src/applications/phragment/storage/PhragmentSnapshotChild.php index 06d33adfba..502ddc2a82 100644 --- a/src/applications/phragment/storage/PhragmentSnapshotChild.php +++ b/src/applications/phragment/storage/PhragmentSnapshotChild.php @@ -11,6 +11,24 @@ final class PhragmentSnapshotChild extends PhragmentDAO private $fragment = self::ATTACHABLE; private $fragmentVersion = self::ATTACHABLE; + public function getConfiguration() { + return array( + self::CONFIG_COLUMN_SCHEMA => array( + 'fragmentVersionPHID' => 'phid?', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_child' => array( + 'columns' => array( + 'snapshotPHID', + 'fragmentPHID', + 'fragmentVersionPHID', + ), + 'unique' => true, + ), + ), + ) + parent::getConfiguration(); + } + public function getSnapshot() { return $this->assertAttached($this->snapshot); } diff --git a/src/applications/phrequent/storage/PhrequentSchemaSpec.php b/src/applications/phrequent/storage/PhrequentSchemaSpec.php new file mode 100644 index 0000000000..b70a0d49ba --- /dev/null +++ b/src/applications/phrequent/storage/PhrequentSchemaSpec.php @@ -0,0 +1,9 @@ +buildLiskSchemata('PhrequentDAO'); + } + +} diff --git a/src/applications/phrequent/storage/PhrequentUserTime.php b/src/applications/phrequent/storage/PhrequentUserTime.php index 5d4ca08c80..22d6c4657e 100644 --- a/src/applications/phrequent/storage/PhrequentUserTime.php +++ b/src/applications/phrequent/storage/PhrequentUserTime.php @@ -11,6 +11,17 @@ final class PhrequentUserTime extends PhrequentDAO private $preemptingEvents = self::ATTACHABLE; + public function getConfiguration() { + return array( + self::CONFIG_COLUMN_SCHEMA => array( + 'objectPHID' => 'phid?', + 'note' => 'text?', + 'dateStarted' => 'epoch', + 'dateEnded' => 'epoch?', + ), + ) + parent::getConfiguration(); + } + public function getCapabilities() { return array( PhabricatorPolicyCapability::CAN_VIEW, diff --git a/src/applications/phriction/storage/PhrictionContent.php b/src/applications/phriction/storage/PhrictionContent.php index 9a5726a90c..f7b58f07eb 100644 --- a/src/applications/phriction/storage/PhrictionContent.php +++ b/src/applications/phriction/storage/PhrictionContent.php @@ -28,6 +28,32 @@ final class PhrictionContent extends PhrictionDAO $viewer); } + public function getConfiguration() { + return array( + self::CONFIG_COLUMN_SCHEMA => array( + 'version' => 'uint32', + 'title' => 'text', + 'slug' => 'text128', + 'content' => 'text', + 'description' => 'text', + 'changeType' => 'uint32', + 'changeRef' => 'uint32?', + ), + self::CONFIG_KEY_SCHEMA => array( + 'documentID' => array( + 'columns' => array('documentID', 'version'), + 'unique' => true, + ), + 'authorPHID' => array( + 'columns' => array('authorPHID'), + ), + 'slug' => array( + 'columns' => array('slug(255)'), + ), + ), + ) + parent::getConfiguration(); + } + /* -( Markup Interface )--------------------------------------------------- */ diff --git a/src/applications/phriction/storage/PhrictionDocument.php b/src/applications/phriction/storage/PhrictionDocument.php index 45fdf6d0aa..0ce1383d68 100644 --- a/src/applications/phriction/storage/PhrictionDocument.php +++ b/src/applications/phriction/storage/PhrictionDocument.php @@ -24,6 +24,27 @@ final class PhrictionDocument extends PhrictionDAO return array( self::CONFIG_AUX_PHID => true, self::CONFIG_TIMESTAMPS => false, + self::CONFIG_COLUMN_SCHEMA => array( + 'slug' => 'text128', + 'depth' => 'uint32', + 'contentID' => 'id?', + 'status' => 'uint32', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_phid' => null, + 'phid' => array( + 'columns' => array('phid'), + 'unique' => true, + ), + 'slug' => array( + 'columns' => array('slug'), + 'unique' => true, + ), + 'depth' => array( + 'columns' => array('depth', 'slug'), + 'unique' => true, + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/phriction/storage/PhrictionSchemaSpec.php b/src/applications/phriction/storage/PhrictionSchemaSpec.php new file mode 100644 index 0000000000..2026993af5 --- /dev/null +++ b/src/applications/phriction/storage/PhrictionSchemaSpec.php @@ -0,0 +1,11 @@ +buildLiskSchemata('PhrictionDAO'); + + $this->buildEdgeSchemata(new PhrictionDocument()); + } + +} diff --git a/src/applications/policy/storage/PhabricatorPolicy.php b/src/applications/policy/storage/PhabricatorPolicy.php index 3840b51f04..30d521911c 100644 --- a/src/applications/policy/storage/PhabricatorPolicy.php +++ b/src/applications/policy/storage/PhabricatorPolicy.php @@ -25,6 +25,16 @@ final class PhabricatorPolicy self::CONFIG_SERIALIZATION => array( 'rules' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'defaultAction' => 'text32', + ), + self::CONFIG_KEY_SCHEMA => array( + 'key_phid' => null, + 'phid' => array( + 'columns' => array('phid'), + 'unique' => true, + ), + ), ) + parent::getConfiguration(); } diff --git a/src/applications/policy/storage/PhabricatorPolicySchemaSpec.php b/src/applications/policy/storage/PhabricatorPolicySchemaSpec.php new file mode 100644 index 0000000000..72b022a08d --- /dev/null +++ b/src/applications/policy/storage/PhabricatorPolicySchemaSpec.php @@ -0,0 +1,9 @@ +buildLiskSchemata('PhabricatorPolicyDAO'); + } + +}