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 @@ -2000,6 +2000,7 @@ '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 @@ '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 @@ '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 @@ '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 @@ '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 @@ '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 @@ 'PhabricatorPolicyRuleLunarPhase' => 'PhabricatorPolicyRule', 'PhabricatorPolicyRuleProjects' => 'PhabricatorPolicyRule', 'PhabricatorPolicyRuleUsers' => 'PhabricatorPolicyRule', + 'PhabricatorPolicySchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorPolicyTestCase' => 'PhabricatorTestCase', 'PhabricatorPolicyTestObject' => 'PhabricatorPolicyInterface', 'PhabricatorPolicyType' => 'PhabricatorPolicyConstants', @@ -5564,6 +5571,7 @@ 'PholioMockViewController' => 'PholioController', 'PholioRemarkupRule' => 'PhabricatorObjectRemarkupRule', 'PholioReplyHandler' => 'PhabricatorMailReplyHandler', + 'PholioSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PholioSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PholioTransaction' => 'PhabricatorApplicationTransaction', 'PholioTransactionComment' => 'PhabricatorApplicationTransactionComment', @@ -5633,6 +5641,7 @@ ), 'PhortunePurchaseQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhortunePurchaseViewController' => 'PhortuneController', + 'PhortuneSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhortuneStripePaymentProvider' => 'PhortunePaymentProvider', 'PhortuneTestExtraPaymentProvider' => 'PhortunePaymentProvider', 'PhortuneTestPaymentProvider' => 'PhortunePaymentProvider', @@ -5662,6 +5671,7 @@ 'PhragmentPolicyController' => 'PhragmentController', 'PhragmentQueryFragmentsConduitAPIMethod' => 'PhragmentConduitAPIMethod', 'PhragmentRevertController' => 'PhragmentController', + 'PhragmentSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhragmentSnapshot' => array( 'PhragmentDAO', 'PhabricatorPolicyInterface', @@ -5686,6 +5696,7 @@ 'PhrequentListController' => 'PhrequentController', 'PhrequentPopConduitAPIMethod' => 'PhrequentConduitAPIMethod', 'PhrequentPushConduitAPIMethod' => 'PhrequentConduitAPIMethod', + 'PhrequentSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhrequentSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhrequentTimeBlock' => 'Phobject', 'PhrequentTimeBlockTestCase' => 'PhabricatorTestCase', @@ -5735,6 +5746,7 @@ '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 --- a/src/applications/pholio/storage/PholioImage.php +++ b/src/applications/pholio/storage/PholioImage.php @@ -22,6 +22,24 @@ 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 --- a/src/applications/pholio/storage/PholioMock.php +++ b/src/applications/pholio/storage/PholioMock.php @@ -52,6 +52,23 @@ 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 --- /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 --- a/src/applications/pholio/storage/PholioTransactionComment.php +++ b/src/applications/pholio/storage/PholioTransactionComment.php @@ -14,6 +14,26 @@ 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 --- a/src/applications/phortune/storage/PhortuneAccount.php +++ b/src/applications/phortune/storage/PhortuneAccount.php @@ -17,6 +17,10 @@ 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 --- a/src/applications/phortune/storage/PhortuneCart.php +++ b/src/applications/phortune/storage/PhortuneCart.php @@ -21,6 +21,14 @@ 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 --- a/src/applications/phortune/storage/PhortuneCharge.php +++ b/src/applications/phortune/storage/PhortuneCharge.php @@ -33,6 +33,20 @@ 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 --- a/src/applications/phortune/storage/PhortunePaymentMethod.php +++ b/src/applications/phortune/storage/PhortunePaymentMethod.php @@ -29,6 +29,20 @@ 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 --- a/src/applications/phortune/storage/PhortuneProduct.php +++ b/src/applications/phortune/storage/PhortuneProduct.php @@ -27,6 +27,19 @@ 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 --- a/src/applications/phortune/storage/PhortunePurchase.php +++ b/src/applications/phortune/storage/PhortunePurchase.php @@ -31,6 +31,18 @@ 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 --- /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 --- a/src/applications/phragment/storage/PhragmentFragment.php +++ b/src/applications/phragment/storage/PhragmentFragment.php @@ -14,6 +14,17 @@ 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 --- a/src/applications/phragment/storage/PhragmentFragmentVersion.php +++ b/src/applications/phragment/storage/PhragmentFragmentVersion.php @@ -13,6 +13,16 @@ 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 --- /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 --- a/src/applications/phragment/storage/PhragmentSnapshot.php +++ b/src/applications/phragment/storage/PhragmentSnapshot.php @@ -11,6 +11,15 @@ 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 --- a/src/applications/phragment/storage/PhragmentSnapshotChild.php +++ b/src/applications/phragment/storage/PhragmentSnapshotChild.php @@ -11,6 +11,24 @@ 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 --- /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 --- a/src/applications/phrequent/storage/PhrequentUserTime.php +++ b/src/applications/phrequent/storage/PhrequentUserTime.php @@ -11,6 +11,17 @@ 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 --- a/src/applications/phriction/storage/PhrictionContent.php +++ b/src/applications/phriction/storage/PhrictionContent.php @@ -28,6 +28,32 @@ $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 --- a/src/applications/phriction/storage/PhrictionDocument.php +++ b/src/applications/phriction/storage/PhrictionDocument.php @@ -24,6 +24,27 @@ 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 --- /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 --- a/src/applications/policy/storage/PhabricatorPolicy.php +++ b/src/applications/policy/storage/PhabricatorPolicy.php @@ -25,6 +25,16 @@ 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 --- /dev/null +++ b/src/applications/policy/storage/PhabricatorPolicySchemaSpec.php @@ -0,0 +1,9 @@ +buildLiskSchemata('PhabricatorPolicyDAO'); + } + +}