1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-22 13:30:55 +01:00

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
This commit is contained in:
epriestley 2014-10-01 07:52:26 -07:00
parent e7b590a1cf
commit cfbcd69e9b
24 changed files with 320 additions and 0 deletions

View file

@ -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',

View file

@ -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();
}

View file

@ -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();
}

View file

@ -0,0 +1,15 @@
<?php
final class PholioSchemaSpec extends PhabricatorConfigSchemaSpec {
public function buildSchemata() {
$this->buildLiskSchemata('PholioDAO');
$this->buildEdgeSchemata(new PholioMock());
$this->buildTransactionSchema(
new PholioTransaction(),
new PholioTransactionComment());
}
}

View file

@ -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(),

View file

@ -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();
}

View file

@ -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();
}

View file

@ -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();
}

View file

@ -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();
}

View file

@ -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();
}

View file

@ -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();
}

View file

@ -0,0 +1,17 @@
<?php
final class PhortuneSchemaSpec extends PhabricatorConfigSchemaSpec {
public function buildSchemata() {
$this->buildLiskSchemata('PhortuneDAO');
$this->buildEdgeSchemata(new PhortuneAccount());
$this->buildTransactionSchema(
new PhortuneAccountTransaction());
$this->buildTransactionSchema(
new PhortuneProductTransaction());
}
}

View file

@ -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();
}

View file

@ -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();
}

View file

@ -0,0 +1,11 @@
<?php
final class PhragmentSchemaSpec extends PhabricatorConfigSchemaSpec {
public function buildSchemata() {
$this->buildLiskSchemata('PhragmentDAO');
$this->buildEdgeSchemata(new PhragmentFragment());
}
}

View file

@ -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();
}

View file

@ -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);
}

View file

@ -0,0 +1,9 @@
<?php
final class PhrequentSchemaSpec extends PhabricatorConfigSchemaSpec {
public function buildSchemata() {
$this->buildLiskSchemata('PhrequentDAO');
}
}

View file

@ -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,

View file

@ -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 )--------------------------------------------------- */

View file

@ -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();
}

View file

@ -0,0 +1,11 @@
<?php
final class PhrictionSchemaSpec extends PhabricatorConfigSchemaSpec {
public function buildSchemata() {
$this->buildLiskSchemata('PhrictionDAO');
$this->buildEdgeSchemata(new PhrictionDocument());
}
}

View file

@ -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();
}

View file

@ -0,0 +1,9 @@
<?php
final class PhabricatorPolicySchemaSpec extends PhabricatorConfigSchemaSpec {
public function buildSchemata() {
$this->buildLiskSchemata('PhabricatorPolicyDAO');
}
}