Skip to content

Commit 7499cb2

Browse files
author
epriestley
committedSep 19, 2014
Generate expected schemata for Workers, XHProf, PHPAAST, Tokens, System, Slowvote
Summary: T1191. Nothing very notable here. Test Plan: Saw more blue in web UI. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D10522
1 parent e9ac3f4 commit 7499cb2

19 files changed

+203
-0
lines changed
 

‎src/__phutil_library_map__.php

+12
Original file line numberDiff line numberDiff line change
@@ -2266,6 +2266,7 @@
22662266
'PhabricatorSlowvotePollController' => 'applications/slowvote/controller/PhabricatorSlowvotePollController.php',
22672267
'PhabricatorSlowvotePollPHIDType' => 'applications/slowvote/phid/PhabricatorSlowvotePollPHIDType.php',
22682268
'PhabricatorSlowvoteQuery' => 'applications/slowvote/query/PhabricatorSlowvoteQuery.php',
2269+
'PhabricatorSlowvoteSchemaSpec' => 'applications/slowvote/storage/PhabricatorSlowvoteSchemaSpec.php',
22692270
'PhabricatorSlowvoteSearchEngine' => 'applications/slowvote/query/PhabricatorSlowvoteSearchEngine.php',
22702271
'PhabricatorSlowvoteTransaction' => 'applications/slowvote/storage/PhabricatorSlowvoteTransaction.php',
22712272
'PhabricatorSlowvoteTransactionComment' => 'applications/slowvote/storage/PhabricatorSlowvoteTransactionComment.php',
@@ -2322,6 +2323,7 @@
23222323
'PhabricatorSystemRemoveDestroyWorkflow' => 'applications/system/management/PhabricatorSystemRemoveDestroyWorkflow.php',
23232324
'PhabricatorSystemRemoveLogWorkflow' => 'applications/system/management/PhabricatorSystemRemoveLogWorkflow.php',
23242325
'PhabricatorSystemRemoveWorkflow' => 'applications/system/management/PhabricatorSystemRemoveWorkflow.php',
2326+
'PhabricatorSystemSchemaSpec' => 'applications/system/storage/PhabricatorSystemSchemaSpec.php',
23252327
'PhabricatorSystemSelectEncodingController' => 'applications/system/controller/PhabricatorSystemSelectEncodingController.php',
23262328
'PhabricatorSystemSelectHighlightController' => 'applications/system/controller/PhabricatorSystemSelectHighlightController.php',
23272329
'PhabricatorTaskmasterDaemon' => 'infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php',
@@ -2349,6 +2351,7 @@
23492351
'PhabricatorTokenQuery' => 'applications/tokens/query/PhabricatorTokenQuery.php',
23502352
'PhabricatorTokenReceiverInterface' => 'applications/tokens/interface/PhabricatorTokenReceiverInterface.php',
23512353
'PhabricatorTokenReceiverQuery' => 'applications/tokens/query/PhabricatorTokenReceiverQuery.php',
2354+
'PhabricatorTokenSchemaSpec' => 'applications/tokens/storage/PhabricatorTokenSchemaSpec.php',
23522355
'PhabricatorTokenTokenPHIDType' => 'applications/tokens/phid/PhabricatorTokenTokenPHIDType.php',
23532356
'PhabricatorTokenUIEventListener' => 'applications/tokens/event/PhabricatorTokenUIEventListener.php',
23542357
'PhabricatorTokensApplication' => 'applications/tokens/application/PhabricatorTokensApplication.php',
@@ -2417,6 +2420,7 @@
24172420
'PhabricatorWorkerDAO' => 'infrastructure/daemon/workers/storage/PhabricatorWorkerDAO.php',
24182421
'PhabricatorWorkerLeaseQuery' => 'infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php',
24192422
'PhabricatorWorkerPermanentFailureException' => 'infrastructure/daemon/workers/exception/PhabricatorWorkerPermanentFailureException.php',
2423+
'PhabricatorWorkerSchemaSpec' => 'infrastructure/daemon/workers/storage/PhabricatorWorkerSchemaSpec.php',
24202424
'PhabricatorWorkerTask' => 'infrastructure/daemon/workers/storage/PhabricatorWorkerTask.php',
24212425
'PhabricatorWorkerTaskData' => 'infrastructure/daemon/workers/storage/PhabricatorWorkerTaskData.php',
24222426
'PhabricatorWorkerTaskDetailController' => 'applications/daemon/controller/PhabricatorWorkerTaskDetailController.php',
@@ -2434,6 +2438,7 @@
24342438
'PhabricatorXHPASTViewPanelController' => 'applications/phpast/controller/PhabricatorXHPASTViewPanelController.php',
24352439
'PhabricatorXHPASTViewParseTree' => 'applications/phpast/storage/PhabricatorXHPASTViewParseTree.php',
24362440
'PhabricatorXHPASTViewRunController' => 'applications/phpast/controller/PhabricatorXHPASTViewRunController.php',
2441+
'PhabricatorXHPASTViewSchemaSpec' => 'applications/phpast/storage/PhabricatorXHPASTViewSchemaSpec.php',
24372442
'PhabricatorXHPASTViewStreamController' => 'applications/phpast/controller/PhabricatorXHPASTViewStreamController.php',
24382443
'PhabricatorXHPASTViewTreeController' => 'applications/phpast/controller/PhabricatorXHPASTViewTreeController.php',
24392444
'PhabricatorXHProfApplication' => 'applications/xhprof/application/PhabricatorXHProfApplication.php',
@@ -2445,6 +2450,7 @@
24452450
'PhabricatorXHProfProfileView' => 'applications/xhprof/view/PhabricatorXHProfProfileView.php',
24462451
'PhabricatorXHProfSample' => 'applications/xhprof/storage/PhabricatorXHProfSample.php',
24472452
'PhabricatorXHProfSampleListController' => 'applications/xhprof/controller/PhabricatorXHProfSampleListController.php',
2453+
'PhabricatorXHProfSchemaSpec' => 'applications/xhprof/storage/PhabricatorXHProfSchemaSpec.php',
24482454
'PhabricatorYoutubeRemarkupRule' => 'infrastructure/markup/rule/PhabricatorYoutubeRemarkupRule.php',
24492455
'PhameBasicBlogSkin' => 'applications/phame/skins/PhameBasicBlogSkin.php',
24502456
'PhameBasicTemplateBlogSkin' => 'applications/phame/skins/PhameBasicTemplateBlogSkin.php',
@@ -5239,6 +5245,7 @@
52395245
'PhabricatorSlowvotePollController' => 'PhabricatorSlowvoteController',
52405246
'PhabricatorSlowvotePollPHIDType' => 'PhabricatorPHIDType',
52415247
'PhabricatorSlowvoteQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
5248+
'PhabricatorSlowvoteSchemaSpec' => 'PhabricatorConfigSchemaSpec',
52425249
'PhabricatorSlowvoteSearchEngine' => 'PhabricatorApplicationSearchEngine',
52435250
'PhabricatorSlowvoteTransaction' => 'PhabricatorApplicationTransaction',
52445251
'PhabricatorSlowvoteTransactionComment' => 'PhabricatorApplicationTransactionComment',
@@ -5287,6 +5294,7 @@
52875294
'PhabricatorSystemRemoveDestroyWorkflow' => 'PhabricatorSystemRemoveWorkflow',
52885295
'PhabricatorSystemRemoveLogWorkflow' => 'PhabricatorSystemRemoveWorkflow',
52895296
'PhabricatorSystemRemoveWorkflow' => 'PhabricatorManagementWorkflow',
5297+
'PhabricatorSystemSchemaSpec' => 'PhabricatorConfigSchemaSpec',
52905298
'PhabricatorSystemSelectEncodingController' => 'PhabricatorController',
52915299
'PhabricatorSystemSelectHighlightController' => 'PhabricatorController',
52925300
'PhabricatorTaskmasterDaemon' => 'PhabricatorDaemon',
@@ -5316,6 +5324,7 @@
53165324
'PhabricatorTokenLeaderController' => 'PhabricatorTokenController',
53175325
'PhabricatorTokenQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
53185326
'PhabricatorTokenReceiverQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
5327+
'PhabricatorTokenSchemaSpec' => 'PhabricatorConfigSchemaSpec',
53195328
'PhabricatorTokenTokenPHIDType' => 'PhabricatorPHIDType',
53205329
'PhabricatorTokenUIEventListener' => 'PhabricatorEventListener',
53215330
'PhabricatorTokensApplication' => 'PhabricatorApplication',
@@ -5391,6 +5400,7 @@
53915400
'PhabricatorWorkerDAO' => 'PhabricatorLiskDAO',
53925401
'PhabricatorWorkerLeaseQuery' => 'PhabricatorQuery',
53935402
'PhabricatorWorkerPermanentFailureException' => 'Exception',
5403+
'PhabricatorWorkerSchemaSpec' => 'PhabricatorConfigSchemaSpec',
53945404
'PhabricatorWorkerTask' => 'PhabricatorWorkerDAO',
53955405
'PhabricatorWorkerTaskData' => 'PhabricatorWorkerDAO',
53965406
'PhabricatorWorkerTaskDetailController' => 'PhabricatorDaemonController',
@@ -5408,6 +5418,7 @@
54085418
'PhabricatorXHPASTViewPanelController' => 'PhabricatorXHPASTViewController',
54095419
'PhabricatorXHPASTViewParseTree' => 'PhabricatorXHPASTViewDAO',
54105420
'PhabricatorXHPASTViewRunController' => 'PhabricatorXHPASTViewController',
5421+
'PhabricatorXHPASTViewSchemaSpec' => 'PhabricatorConfigSchemaSpec',
54115422
'PhabricatorXHPASTViewStreamController' => 'PhabricatorXHPASTViewPanelController',
54125423
'PhabricatorXHPASTViewTreeController' => 'PhabricatorXHPASTViewPanelController',
54135424
'PhabricatorXHProfApplication' => 'PhabricatorApplication',
@@ -5419,6 +5430,7 @@
54195430
'PhabricatorXHProfProfileView' => 'AphrontView',
54205431
'PhabricatorXHProfSample' => 'PhabricatorXHProfDAO',
54215432
'PhabricatorXHProfSampleListController' => 'PhabricatorXHProfController',
5433+
'PhabricatorXHProfSchemaSpec' => 'PhabricatorConfigSchemaSpec',
54225434
'PhabricatorYoutubeRemarkupRule' => 'PhutilRemarkupRule',
54235435
'PhameBasicBlogSkin' => 'PhameBlogSkin',
54245436
'PhameBasicTemplateBlogSkin' => 'PhameBasicBlogSkin',

‎src/applications/config/schema/PhabricatorConfigSchemaSpec.php

+18
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,21 @@ protected function buildEdgeSchemata(PhabricatorLiskDAO $object) {
138138
));
139139
}
140140

141+
public function buildCounterSchema(PhabricatorLiskDAO $object) {
142+
$this->buildRawSchema(
143+
$object->getApplicationName(),
144+
PhabricatorLiskDAO::COUNTER_TABLE_NAME,
145+
array(
146+
'counterName' => 'text32',
147+
'counterValue' => 'id64',
148+
),
149+
array(
150+
'PRIMARY' => array(
151+
'columns' => array('counterName'),
152+
),
153+
));
154+
}
155+
141156
protected function getDatabase($name) {
142157
$server = $this->getServer();
143158

@@ -274,6 +289,9 @@ private function getDetailsForDataType($data_type) {
274289
case 'bool':
275290
$column_type = 'tinyint(1)';
276291
break;
292+
case 'double':
293+
$column_type = 'double';
294+
break;
277295
default:
278296
$column_type = pht('<unknown>');
279297
$charset = pht('<unknown>');

‎src/applications/phpast/storage/PhabricatorXHPASTViewParseTree.php

+10
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,14 @@ final class PhabricatorXHPASTViewParseTree extends PhabricatorXHPASTViewDAO {
66

77
protected $input;
88
protected $stdout;
9+
10+
public function getConfiguration() {
11+
return array(
12+
self::CONFIG_COLUMN_SCHEMA => array(
13+
'authorPHID' => 'phid?',
14+
'input' => 'text',
15+
'stdout' => 'text',
16+
),
17+
) + parent::getConfiguration();
18+
}
919
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
final class PhabricatorXHPASTViewSchemaSpec
4+
extends PhabricatorConfigSchemaSpec {
5+
6+
public function buildSchemata() {
7+
$this->buildLiskSchemata('PhabricatorXHPASTViewDAO');
8+
}
9+
10+
}

‎src/applications/slowvote/storage/PhabricatorSlowvoteOption.php

+8
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,12 @@ final class PhabricatorSlowvoteOption extends PhabricatorSlowvoteDAO {
55
protected $pollID;
66
protected $name;
77

8+
public function getConfiguration() {
9+
return array(
10+
self::CONFIG_COLUMN_SCHEMA => array(
11+
'name' => 'text255',
12+
),
13+
) + parent::getConfiguration();
14+
}
15+
816
}

‎src/applications/slowvote/storage/PhabricatorSlowvotePoll.php

+14
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,20 @@ public static function initializeNewPoll(PhabricatorUser $actor) {
4646
public function getConfiguration() {
4747
return array(
4848
self::CONFIG_AUX_PHID => true,
49+
self::CONFIG_COLUMN_SCHEMA => array(
50+
'question' => 'text255',
51+
'responseVisibility' => 'uint32',
52+
'shuffle' => 'uint32',
53+
'method' => 'uint32',
54+
'description' => 'text',
55+
'isClosed' => 'bool',
56+
),
57+
self::CONFIG_KEY_SCHEMA => array(
58+
'key_phid' => null,
59+
'phid' => array(
60+
'columns' => array('phid'),
61+
),
62+
),
4963
) + parent::getConfiguration();
5064
}
5165

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
final class PhabricatorSlowvoteSchemaSpec
4+
extends PhabricatorConfigSchemaSpec {
5+
6+
public function buildSchemata() {
7+
$this->buildLiskSchemata('PhabricatorSlowvoteDAO');
8+
$this->buildEdgeSchemata(new PhabricatorSlowvotePoll());
9+
$this->buildTransactionSchema(
10+
new PhabricatorSlowvoteTransaction(),
11+
new PhabricatorSlowvoteTransactionComment());
12+
}
13+
14+
}

‎src/applications/system/storage/PhabricatorSystemActionLog.php

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ final class PhabricatorSystemActionLog extends PhabricatorSystemDAO {
1111
public function getConfiguration() {
1212
return array(
1313
self::CONFIG_TIMESTAMPS => false,
14+
self::CONFIG_COLUMN_SCHEMA => array(
15+
'actorHash' => 'bytes12',
16+
'actorIdentity' => 'text255',
17+
'action' => 'text32',
18+
'score' => 'double',
19+
),
1420
) + parent::getConfiguration();
1521
}
1622

‎src/applications/system/storage/PhabricatorSystemDestructionLog.php

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ final class PhabricatorSystemDestructionLog extends PhabricatorSystemDAO {
1111
public function getConfiguration() {
1212
return array(
1313
self::CONFIG_TIMESTAMPS => false,
14+
self::CONFIG_COLUMN_SCHEMA => array(
15+
'objectClass' => 'text128',
16+
'rootLogID' => 'id?',
17+
'objectPHID' => 'phid?',
18+
'objectMonogram' => 'text64?',
19+
),
1420
) + parent::getConfiguration();
1521
}
1622

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
final class PhabricatorSystemSchemaSpec
4+
extends PhabricatorConfigSchemaSpec {
5+
6+
public function buildSchemata() {
7+
$this->buildLiskSchemata('PhabricatorSystemDAO');
8+
}
9+
10+
}

‎src/applications/tokens/storage/PhabricatorTokenCount.php

+8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ public function getConfiguration() {
99
return array(
1010
self::CONFIG_IDS => self::IDS_MANUAL,
1111
self::CONFIG_TIMESTAMPS => false,
12+
self::CONFIG_COLUMN_SCHEMA => array(
13+
'tokenCount' => 'uint32',
14+
),
15+
self::CONFIG_KEY_SCHEMA => array(
16+
'key_objectPHID' => array(
17+
'columns' => array('objectPHID'),
18+
),
19+
),
1220
) + parent::getConfiguration();
1321
}
1422

‎src/applications/tokens/storage/PhabricatorTokenGiven.php

+10
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ final class PhabricatorTokenGiven extends PhabricatorTokenDAO
99

1010
private $object = self::ATTACHABLE;
1111

12+
public function getConfiguration() {
13+
return array(
14+
self::CONFIG_KEY_SCHEMA => array(
15+
'key_all' => array(
16+
'columns' => array('objectPHID', 'authorPHID'),
17+
),
18+
),
19+
) + parent::getConfiguration();
20+
}
21+
1222
public function attachObject(PhabricatorTokenReceiverInterface $object) {
1323
$this->object = $object;
1424
return $this;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
final class PhabricatorTokenSchemaSpec
4+
extends PhabricatorConfigSchemaSpec {
5+
6+
public function buildSchemata() {
7+
$this->buildLiskSchemata('PhabricatorTokenDAO');
8+
}
9+
10+
}

‎src/applications/xhprof/storage/PhabricatorXHProfSample.php

+19
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,23 @@ final class PhabricatorXHProfSample extends PhabricatorXHProfDAO {
99
protected $requestPath;
1010
protected $controller;
1111
protected $userPHID;
12+
13+
public function getConfiguration() {
14+
return array(
15+
self::CONFIG_COLUMN_SCHEMA => array(
16+
'sampleRate' => 'uint32',
17+
'usTotal' => 'uint64',
18+
'hostname' => 'text255?',
19+
'requestPath' => 'text255?',
20+
'controller' => 'text255?',
21+
'userPHID' => 'phid?',
22+
),
23+
self::CONFIG_KEY_SCHEMA => array(
24+
'filePHID' => array(
25+
'columns' => array('filePHID'),
26+
),
27+
),
28+
) + parent::getConfiguration();
29+
}
30+
1231
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
final class PhabricatorXHProfSchemaSpec
4+
extends PhabricatorConfigSchemaSpec {
5+
6+
public function buildSchemata() {
7+
$this->buildLiskSchemata('PhabricatorXHProfDAO');
8+
}
9+
10+
}

‎src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ public function getConfiguration() {
1111
return array(
1212
self::CONFIG_IDS => self::IDS_COUNTER,
1313
self::CONFIG_TIMESTAMPS => false,
14+
self::CONFIG_KEY_SCHEMA => array(
15+
'dataID' => array(
16+
'columns' => array('dataID'),
17+
),
18+
),
1419
) + parent::getConfiguration();
1520
}
1621

‎src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php

+9
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ final class PhabricatorWorkerArchiveTask extends PhabricatorWorkerTask {
99
protected $duration;
1010
protected $result;
1111

12+
public function getConfiguration() {
13+
$config = parent::getConfiguration();
14+
$config[self::CONFIG_COLUMN_SCHEMA] = array(
15+
'result' => 'uint32',
16+
'duration' => 'uint64',
17+
) + $config[self::CONFIG_COLUMN_SCHEMA];
18+
return $config;
19+
}
20+
1221
public function save() {
1322
if ($this->getID() === null) {
1423
throw new Exception('Trying to archive a task with no ID.');
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
final class PhabricatorWorkerSchemaSpec
4+
extends PhabricatorConfigSchemaSpec {
5+
6+
public function buildSchemata() {
7+
$this->buildLiskSchemata('PhabricatorWorkerDAO');
8+
$this->buildCounterSchema(new PhabricatorWorkerActiveTask());
9+
}
10+
11+
}

‎src/infrastructure/daemon/workers/storage/PhabricatorWorkerTask.php

+13
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ abstract class PhabricatorWorkerTask extends PhabricatorWorkerDAO {
1414
private $data;
1515
private $executionException;
1616

17+
public function getConfiguration() {
18+
return array(
19+
self::CONFIG_COLUMN_SCHEMA => array(
20+
'taskClass' => 'text255',
21+
'leaseOwner' => 'text255?',
22+
'leaseExpires' => 'epoch?',
23+
'failureCount' => 'uint32',
24+
'failureTime' => 'epoch?',
25+
'priority' => 'uint32',
26+
),
27+
) + parent::getConfiguration();
28+
}
29+
1730
final public function setExecutionException(Exception $execution_exception) {
1831
$this->executionException = $execution_exception;
1932
return $this;

0 commit comments

Comments
 (0)
Failed to load comments.