1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 03:50:54 +01:00

Generate reasonable expected schemata for Chatlog, Conduit, Config, Countdown, Daemons

Summary: Ref T1191. Fills in some more of the databases. Nothing very notable here. I didn't encounter any issues or overlong keys.

Test Plan: Used web UI to click around and verify expected schemata match up against actual schemata well.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T1191

Differential Revision: https://secure.phabricator.com/D10516
This commit is contained in:
epriestley 2014-09-18 11:15:29 -07:00
parent 3238f1e091
commit 1ead50c2cc
17 changed files with 165 additions and 0 deletions

View file

@ -1310,6 +1310,7 @@ phutil_register_library_map(array(
'PhabricatorChatLogEvent' => 'applications/chatlog/storage/PhabricatorChatLogEvent.php',
'PhabricatorChatLogEventType' => 'applications/chatlog/constants/PhabricatorChatLogEventType.php',
'PhabricatorChatLogQuery' => 'applications/chatlog/query/PhabricatorChatLogQuery.php',
'PhabricatorChatLogSchemaSpec' => 'applications/chatlog/storage/PhabricatorChatLogSchemaSpec.php',
'PhabricatorCommitBranchesField' => 'applications/repository/customfield/PhabricatorCommitBranchesField.php',
'PhabricatorCommitCustomField' => 'applications/repository/customfield/PhabricatorCommitCustomField.php',
'PhabricatorCommitSearchEngine' => 'applications/audit/query/PhabricatorCommitSearchEngine.php',
@ -1328,6 +1329,7 @@ phutil_register_library_map(array(
'PhabricatorConduitLogQuery' => 'applications/conduit/query/PhabricatorConduitLogQuery.php',
'PhabricatorConduitMethodCallLog' => 'applications/conduit/storage/PhabricatorConduitMethodCallLog.php',
'PhabricatorConduitMethodQuery' => 'applications/conduit/query/PhabricatorConduitMethodQuery.php',
'PhabricatorConduitSchemaSpec' => 'applications/conduit/storage/PhabricatorConduitSchemaSpec.php',
'PhabricatorConduitSearchEngine' => 'applications/conduit/query/PhabricatorConduitSearchEngine.php',
'PhabricatorConduitTokenController' => 'applications/conduit/controller/PhabricatorConduitTokenController.php',
'PhabricatorConfigAllController' => 'applications/config/controller/PhabricatorConfigAllController.php',
@ -1367,6 +1369,7 @@ phutil_register_library_map(array(
'PhabricatorConfigSchemaQuery' => 'applications/config/schema/PhabricatorConfigSchemaQuery.php',
'PhabricatorConfigSchemaSpec' => 'applications/config/schema/PhabricatorConfigSchemaSpec.php',
'PhabricatorConfigServerSchema' => 'applications/config/schema/PhabricatorConfigServerSchema.php',
'PhabricatorConfigSettingsSchemaSpec' => 'applications/config/storage/PhabricatorConfigSettingsSchemaSpec.php',
'PhabricatorConfigSource' => 'infrastructure/env/PhabricatorConfigSource.php',
'PhabricatorConfigStackSource' => 'infrastructure/env/PhabricatorConfigStackSource.php',
'PhabricatorConfigStorageSchema' => 'applications/config/schema/PhabricatorConfigStorageSchema.php',
@ -1393,6 +1396,7 @@ phutil_register_library_map(array(
'PhabricatorCountdownListController' => 'applications/countdown/controller/PhabricatorCountdownListController.php',
'PhabricatorCountdownQuery' => 'applications/countdown/query/PhabricatorCountdownQuery.php',
'PhabricatorCountdownRemarkupRule' => 'applications/countdown/remarkup/PhabricatorCountdownRemarkupRule.php',
'PhabricatorCountdownSchemaSpec' => 'applications/countdown/storage/PhabricatorCountdownSchemaSpec.php',
'PhabricatorCountdownSearchEngine' => 'applications/countdown/query/PhabricatorCountdownSearchEngine.php',
'PhabricatorCountdownView' => 'applications/countdown/view/PhabricatorCountdownView.php',
'PhabricatorCountdownViewController' => 'applications/countdown/controller/PhabricatorCountdownViewController.php',
@ -1438,6 +1442,7 @@ phutil_register_library_map(array(
'PhabricatorDaemonManagementStopWorkflow' => 'applications/daemon/management/PhabricatorDaemonManagementStopWorkflow.php',
'PhabricatorDaemonManagementWorkflow' => 'applications/daemon/management/PhabricatorDaemonManagementWorkflow.php',
'PhabricatorDaemonReference' => 'infrastructure/daemon/control/PhabricatorDaemonReference.php',
'PhabricatorDaemonSchemaSpec' => 'applications/daemon/storage/PhabricatorDaemonSchemaSpec.php',
'PhabricatorDaemonTaskGarbageCollector' => 'applications/daemon/garbagecollector/PhabricatorDaemonTaskGarbageCollector.php',
'PhabricatorDaemonsApplication' => 'applications/daemon/application/PhabricatorDaemonsApplication.php',
'PhabricatorDashboard' => 'applications/dashboard/storage/PhabricatorDashboard.php',
@ -4203,6 +4208,7 @@ phutil_register_library_map(array(
),
'PhabricatorChatLogEventType' => 'PhabricatorChatLogConstants',
'PhabricatorChatLogQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorChatLogSchemaSpec' => 'PhabricatorConfigSchemaSpec',
'PhabricatorCommitBranchesField' => 'PhabricatorCommitCustomField',
'PhabricatorCommitCustomField' => 'PhabricatorCustomField',
'PhabricatorCommitSearchEngine' => 'PhabricatorApplicationSearchEngine',
@ -4224,6 +4230,7 @@ phutil_register_library_map(array(
'PhabricatorPolicyInterface',
),
'PhabricatorConduitMethodQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorConduitSchemaSpec' => 'PhabricatorConfigSchemaSpec',
'PhabricatorConduitSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhabricatorConduitTokenController' => 'PhabricatorConduitController',
'PhabricatorConfigAllController' => 'PhabricatorConfigController',
@ -4267,6 +4274,7 @@ phutil_register_library_map(array(
'PhabricatorConfigSchemaQuery' => 'Phobject',
'PhabricatorConfigSchemaSpec' => 'Phobject',
'PhabricatorConfigServerSchema' => 'PhabricatorConfigStorageSchema',
'PhabricatorConfigSettingsSchemaSpec' => 'PhabricatorConfigSchemaSpec',
'PhabricatorConfigStackSource' => 'PhabricatorConfigSource',
'PhabricatorConfigStorageSchema' => 'Phobject',
'PhabricatorConfigTableSchema' => 'PhabricatorConfigStorageSchema',
@ -4294,6 +4302,7 @@ phutil_register_library_map(array(
'PhabricatorCountdownListController' => 'PhabricatorCountdownController',
'PhabricatorCountdownQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorCountdownRemarkupRule' => 'PhabricatorObjectRemarkupRule',
'PhabricatorCountdownSchemaSpec' => 'PhabricatorConfigSchemaSpec',
'PhabricatorCountdownSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhabricatorCountdownView' => 'AphrontTagView',
'PhabricatorCountdownViewController' => 'PhabricatorCountdownController',
@ -4338,6 +4347,7 @@ phutil_register_library_map(array(
'PhabricatorDaemonManagementStatusWorkflow' => 'PhabricatorDaemonManagementWorkflow',
'PhabricatorDaemonManagementStopWorkflow' => 'PhabricatorDaemonManagementWorkflow',
'PhabricatorDaemonManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorDaemonSchemaSpec' => 'PhabricatorConfigSchemaSpec',
'PhabricatorDaemonTaskGarbageCollector' => 'PhabricatorGarbageCollector',
'PhabricatorDaemonsApplication' => 'PhabricatorApplication',
'PhabricatorDashboard' => array(

View file

@ -10,6 +10,21 @@ final class PhabricatorChatLogChannel
protected $viewPolicy;
protected $editPolicy;
public function getConfiguration() {
return array(
self::CONFIG_COLUMN_SCHEMA => array(
'serviceName' => 'text64',
'serviceType' => 'text32',
'channelName' => 'text64',
),
self::CONFIG_KEY_SCHEMA => array(
'key_channel' => array(
'columns' => array('channelName', 'serviceType', 'serviceName'),
),
),
) + parent::getConfiguration();
}
public function getCapabilities() {
return array(
PhabricatorPolicyCapability::CAN_VIEW,

View file

@ -16,6 +16,11 @@ final class PhabricatorChatLogEvent
public function getConfiguration() {
return array(
self::CONFIG_TIMESTAMPS => false,
self::CONFIG_COLUMN_SCHEMA => array(
'author' => 'text64',
'type' => 'text4',
'message' => 'text',
),
) + parent::getConfiguration();
}

View file

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

View file

@ -5,4 +5,20 @@ final class PhabricatorConduitCertificateToken extends PhabricatorConduitDAO {
protected $userPHID;
protected $token;
public function getConfiguration() {
return array(
self::CONFIG_COLUMN_SCHEMA => array(
'token' => 'text64?',
),
self::CONFIG_KEY_SCHEMA => array(
'userPHID' => array(
'columns' => array('userPHID'),
),
'token' => array(
'columns' => array('token'),
),
),
) + parent::getConfiguration();
}
}

View file

@ -7,4 +7,15 @@ final class PhabricatorConduitConnectionLog extends PhabricatorConduitDAO {
protected $clientDescription;
protected $username;
public function getConfiguration() {
return array(
self::CONFIG_COLUMN_SCHEMA => array(
'client' => 'text255?',
'clientVersion' => 'text255?',
'clientDescription' => 'text255?',
'username' => 'text255?',
),
) + parent::getConfiguration();
}
}

View file

@ -10,6 +10,19 @@ final class PhabricatorConduitMethodCallLog
protected $error;
protected $duration;
public function getConfiguration() {
return array(
self::CONFIG_COLUMN_SCHEMA => array(
'id' => 'id64',
'connectionID' => 'id64?',
'method' => 'text255',
'error' => 'text255',
'duration' => 'uint64',
'callerPHID' => 'phid?',
),
) + parent::getConfiguration();
}
/* -( PhabricatorPolicyInterface )----------------------------------------- */

View file

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

View file

@ -158,6 +158,7 @@ abstract class PhabricatorConfigSchemaSpec extends Phobject {
$column_type = 'int(10) unsigned';
break;
case 'id64':
case 'uint64':
$column_type = 'bigint(20) unsigned';
break;
case 'phid':
@ -166,6 +167,11 @@ abstract class PhabricatorConfigSchemaSpec extends Phobject {
$charset = 'binary';
$collation = 'binary';
break;
case 'bytes40':
$column_type = 'char(40)';
$charset = 'binary';
$collation = 'binary';
break;
case 'bytes12':
$column_type = 'char(12)';
$charset = 'binary';
@ -176,6 +182,11 @@ abstract class PhabricatorConfigSchemaSpec extends Phobject {
$charset = 'binary';
$collation = 'binary';
break;
case 'text255':
$column_type = 'varchar(255)';
$charset = $this->getUTF8Charset();
$collation = $this->getUTF8Collation();
break;
case 'text128':
$column_type = 'varchar(128)';
$charset = $this->getUTF8Charset();
@ -201,6 +212,16 @@ abstract class PhabricatorConfigSchemaSpec extends Phobject {
$charset = $this->getUTF8Charset();
$collation = $this->getUTF8Collation();
break;
case 'text8':
$column_type = 'varchar(8)';
$charset = $this->getUTF8Charset();
$collation = $this->getUTF8Collation();
break;
case 'text4':
$column_type = 'varchar(4)';
$charset = $this->getUTF8Charset();
$collation = $this->getUTF8Collation();
break;
case 'text':
$column_type = 'longtext';
$charset = $this->getUTF8Charset();

View file

@ -14,6 +14,16 @@ final class PhabricatorConfigEntry extends PhabricatorConfigEntryDAO
self::CONFIG_SERIALIZATION => array(
'value' => self::SERIALIZATION_JSON,
),
self::CONFIG_COLUMN_SCHEMA => array(
'namespace' => 'text64',
'configKey' => 'text64',
'isDeleted' => 'bool',
),
self::CONFIG_KEY_SCHEMA => array(
'key_name' => array(
'columns' => array('namespace', 'configKey'),
),
),
) + parent::getConfiguration();
}

View file

@ -0,0 +1,11 @@
<?php
final class PhabricatorConfigSettingsSchemaSpec
extends PhabricatorConfigSchemaSpec {
public function buildSchemata() {
$this->buildLiskSchemata('PhabricatorConfigEntryDAO');
$this->buildTransactionSchema(new PhabricatorConfigTransaction());
}
}

View file

@ -27,6 +27,9 @@ final class PhabricatorCountdown
public function getConfiguration() {
return array(
self::CONFIG_AUX_PHID => true,
self::CONFIG_COLUMN_SCHEMA => array(
'title' => 'text255',
),
) + parent::getConfiguration();
}

View file

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

View file

@ -24,6 +24,13 @@ final class PhabricatorDaemonLog extends PhabricatorDaemonDAO
'argv' => self::SERIALIZATION_JSON,
'explicitArgv' => self::SERIALIZATION_JSON,
),
self::CONFIG_COLUMN_SCHEMA => array(
'daemon' => 'text255',
'host' => 'text255',
'pid' => 'uint32',
'envHash' => 'bytes40',
'status' => 'text8',
),
) + parent::getConfiguration();
}

View file

@ -10,6 +10,10 @@ final class PhabricatorDaemonLogEvent extends PhabricatorDaemonDAO {
public function getConfiguration() {
return array(
self::CONFIG_TIMESTAMPS => false,
self::CONFIG_COLUMN_SCHEMA => array(
'logType' => 'text4',
'message' => 'text',
),
) + parent::getConfiguration();
}

View file

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

View file

@ -1742,6 +1742,7 @@ abstract class LiskDAO {
'phid' => 'phid',
'viewPolicy' => 'policy',
'editPolicy' => 'policy',
'epoch' => 'epoch',
'dateCreated' => 'epoch',
'dateModified' => 'epoch',
);