1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 05:12:41 +01:00

Generate expected schemata for Doorkeeper, Draft, Drydock, Feed

Summary:
Ref T1191. Notable:

  - Allowed objects to remove default columns (some feed tables have no `id`).
  - Added a "note" severity and moved all the charset stuff down to that to make progress more clear.

Test Plan:
Trying to make the whole thing blue...

{F205970}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T1191

Differential Revision: https://secure.phabricator.com/D10519
This commit is contained in:
epriestley 2014-09-18 11:15:49 -07:00
parent 8d0f0d1391
commit 67fbfe6ccc
22 changed files with 203 additions and 9 deletions

View file

@ -570,6 +570,7 @@ phutil_register_library_map(array(
'DoorkeeperRemarkupRule' => 'applications/doorkeeper/remarkup/DoorkeeperRemarkupRule.php', 'DoorkeeperRemarkupRule' => 'applications/doorkeeper/remarkup/DoorkeeperRemarkupRule.php',
'DoorkeeperRemarkupRuleAsana' => 'applications/doorkeeper/remarkup/DoorkeeperRemarkupRuleAsana.php', 'DoorkeeperRemarkupRuleAsana' => 'applications/doorkeeper/remarkup/DoorkeeperRemarkupRuleAsana.php',
'DoorkeeperRemarkupRuleJIRA' => 'applications/doorkeeper/remarkup/DoorkeeperRemarkupRuleJIRA.php', 'DoorkeeperRemarkupRuleJIRA' => 'applications/doorkeeper/remarkup/DoorkeeperRemarkupRuleJIRA.php',
'DoorkeeperSchemaSpec' => 'applications/doorkeeper/storage/DoorkeeperSchemaSpec.php',
'DoorkeeperTagView' => 'applications/doorkeeper/view/DoorkeeperTagView.php', 'DoorkeeperTagView' => 'applications/doorkeeper/view/DoorkeeperTagView.php',
'DoorkeeperTagsController' => 'applications/doorkeeper/controller/DoorkeeperTagsController.php', 'DoorkeeperTagsController' => 'applications/doorkeeper/controller/DoorkeeperTagsController.php',
'DrydockAllocatorWorker' => 'applications/drydock/worker/DrydockAllocatorWorker.php', 'DrydockAllocatorWorker' => 'applications/drydock/worker/DrydockAllocatorWorker.php',
@ -636,6 +637,7 @@ phutil_register_library_map(array(
'DrydockResourceViewController' => 'applications/drydock/controller/DrydockResourceViewController.php', 'DrydockResourceViewController' => 'applications/drydock/controller/DrydockResourceViewController.php',
'DrydockSFTPFilesystemInterface' => 'applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php', 'DrydockSFTPFilesystemInterface' => 'applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php',
'DrydockSSHCommandInterface' => 'applications/drydock/interface/command/DrydockSSHCommandInterface.php', 'DrydockSSHCommandInterface' => 'applications/drydock/interface/command/DrydockSSHCommandInterface.php',
'DrydockSchemaSpec' => 'applications/drydock/storage/DrydockSchemaSpec.php',
'DrydockWebrootInterface' => 'applications/drydock/interface/webroot/DrydockWebrootInterface.php', 'DrydockWebrootInterface' => 'applications/drydock/interface/webroot/DrydockWebrootInterface.php',
'DrydockWorkingCopyBlueprintImplementation' => 'applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php', 'DrydockWorkingCopyBlueprintImplementation' => 'applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php',
'FeedConduitAPIMethod' => 'applications/feed/conduit/FeedConduitAPIMethod.php', 'FeedConduitAPIMethod' => 'applications/feed/conduit/FeedConduitAPIMethod.php',
@ -1514,6 +1516,7 @@ phutil_register_library_map(array(
'PhabricatorDoorkeeperApplication' => 'applications/doorkeeper/application/PhabricatorDoorkeeperApplication.php', 'PhabricatorDoorkeeperApplication' => 'applications/doorkeeper/application/PhabricatorDoorkeeperApplication.php',
'PhabricatorDraft' => 'applications/draft/storage/PhabricatorDraft.php', 'PhabricatorDraft' => 'applications/draft/storage/PhabricatorDraft.php',
'PhabricatorDraftDAO' => 'applications/draft/storage/PhabricatorDraftDAO.php', 'PhabricatorDraftDAO' => 'applications/draft/storage/PhabricatorDraftDAO.php',
'PhabricatorDraftSchemaSpec' => 'applications/draft/storage/PhabricatorDraftSchemaSpec.php',
'PhabricatorDrydockApplication' => 'applications/drydock/application/PhabricatorDrydockApplication.php', 'PhabricatorDrydockApplication' => 'applications/drydock/application/PhabricatorDrydockApplication.php',
'PhabricatorEdgeConfig' => 'infrastructure/edges/constants/PhabricatorEdgeConfig.php', 'PhabricatorEdgeConfig' => 'infrastructure/edges/constants/PhabricatorEdgeConfig.php',
'PhabricatorEdgeConstants' => 'infrastructure/edges/constants/PhabricatorEdgeConstants.php', 'PhabricatorEdgeConstants' => 'infrastructure/edges/constants/PhabricatorEdgeConstants.php',
@ -1574,6 +1577,7 @@ phutil_register_library_map(array(
'PhabricatorFeedManagementWorkflow' => 'applications/feed/management/PhabricatorFeedManagementWorkflow.php', 'PhabricatorFeedManagementWorkflow' => 'applications/feed/management/PhabricatorFeedManagementWorkflow.php',
'PhabricatorFeedPublicStreamController' => 'applications/feed/controller/PhabricatorFeedPublicStreamController.php', 'PhabricatorFeedPublicStreamController' => 'applications/feed/controller/PhabricatorFeedPublicStreamController.php',
'PhabricatorFeedQuery' => 'applications/feed/query/PhabricatorFeedQuery.php', 'PhabricatorFeedQuery' => 'applications/feed/query/PhabricatorFeedQuery.php',
'PhabricatorFeedSchemaSpec' => 'applications/feed/storage/PhabricatorFeedSchemaSpec.php',
'PhabricatorFeedSearchEngine' => 'applications/feed/query/PhabricatorFeedSearchEngine.php', 'PhabricatorFeedSearchEngine' => 'applications/feed/query/PhabricatorFeedSearchEngine.php',
'PhabricatorFeedStory' => 'applications/feed/story/PhabricatorFeedStory.php', 'PhabricatorFeedStory' => 'applications/feed/story/PhabricatorFeedStory.php',
'PhabricatorFeedStoryAggregate' => 'applications/feed/story/PhabricatorFeedStoryAggregate.php', 'PhabricatorFeedStoryAggregate' => 'applications/feed/story/PhabricatorFeedStoryAggregate.php',
@ -3373,6 +3377,7 @@ phutil_register_library_map(array(
'DoorkeeperRemarkupRule' => 'PhutilRemarkupRule', 'DoorkeeperRemarkupRule' => 'PhutilRemarkupRule',
'DoorkeeperRemarkupRuleAsana' => 'DoorkeeperRemarkupRule', 'DoorkeeperRemarkupRuleAsana' => 'DoorkeeperRemarkupRule',
'DoorkeeperRemarkupRuleJIRA' => 'DoorkeeperRemarkupRule', 'DoorkeeperRemarkupRuleJIRA' => 'DoorkeeperRemarkupRule',
'DoorkeeperSchemaSpec' => 'PhabricatorConfigSchemaSpec',
'DoorkeeperTagView' => 'AphrontView', 'DoorkeeperTagView' => 'AphrontView',
'DoorkeeperTagsController' => 'PhabricatorController', 'DoorkeeperTagsController' => 'PhabricatorController',
'DrydockAllocatorWorker' => 'PhabricatorWorker', 'DrydockAllocatorWorker' => 'PhabricatorWorker',
@ -3451,6 +3456,7 @@ phutil_register_library_map(array(
'DrydockResourceViewController' => 'DrydockResourceController', 'DrydockResourceViewController' => 'DrydockResourceController',
'DrydockSFTPFilesystemInterface' => 'DrydockFilesystemInterface', 'DrydockSFTPFilesystemInterface' => 'DrydockFilesystemInterface',
'DrydockSSHCommandInterface' => 'DrydockCommandInterface', 'DrydockSSHCommandInterface' => 'DrydockCommandInterface',
'DrydockSchemaSpec' => 'PhabricatorConfigSchemaSpec',
'DrydockWebrootInterface' => 'DrydockInterface', 'DrydockWebrootInterface' => 'DrydockInterface',
'DrydockWorkingCopyBlueprintImplementation' => 'DrydockBlueprintImplementation', 'DrydockWorkingCopyBlueprintImplementation' => 'DrydockBlueprintImplementation',
'FeedConduitAPIMethod' => 'ConduitAPIMethod', 'FeedConduitAPIMethod' => 'ConduitAPIMethod',
@ -4430,6 +4436,7 @@ phutil_register_library_map(array(
'PhabricatorDoorkeeperApplication' => 'PhabricatorApplication', 'PhabricatorDoorkeeperApplication' => 'PhabricatorApplication',
'PhabricatorDraft' => 'PhabricatorDraftDAO', 'PhabricatorDraft' => 'PhabricatorDraftDAO',
'PhabricatorDraftDAO' => 'PhabricatorLiskDAO', 'PhabricatorDraftDAO' => 'PhabricatorLiskDAO',
'PhabricatorDraftSchemaSpec' => 'PhabricatorConfigSchemaSpec',
'PhabricatorDrydockApplication' => 'PhabricatorApplication', 'PhabricatorDrydockApplication' => 'PhabricatorApplication',
'PhabricatorEdgeConfig' => 'PhabricatorEdgeConstants', 'PhabricatorEdgeConfig' => 'PhabricatorEdgeConstants',
'PhabricatorEdgeCycleException' => 'Exception', 'PhabricatorEdgeCycleException' => 'Exception',
@ -4486,6 +4493,7 @@ phutil_register_library_map(array(
'PhabricatorFeedManagementWorkflow' => 'PhabricatorManagementWorkflow', 'PhabricatorFeedManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorFeedPublicStreamController' => 'PhabricatorFeedController', 'PhabricatorFeedPublicStreamController' => 'PhabricatorFeedController',
'PhabricatorFeedQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorFeedQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorFeedSchemaSpec' => 'PhabricatorConfigSchemaSpec',
'PhabricatorFeedSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorFeedSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhabricatorFeedStory' => array( 'PhabricatorFeedStory' => array(
'PhabricatorPolicyInterface', 'PhabricatorPolicyInterface',

View file

@ -31,6 +31,9 @@ final class PhabricatorAuthProviderConfig extends PhabricatorAuthDAO
), ),
self::CONFIG_COLUMN_SCHEMA => array( self::CONFIG_COLUMN_SCHEMA => array(
'isEnabled' => 'bool', 'isEnabled' => 'bool',
'providerClass' => 'text128',
'providerType' => 'text64',
'providerDomain' => 'text128',
'shouldAllowLogin' => 'bool', 'shouldAllowLogin' => 'bool',
'shouldAllowRegistration' => 'bool', 'shouldAllowRegistration' => 'bool',
'shouldAllowLink' => 'bool', 'shouldAllowLink' => 'bool',

View file

@ -688,6 +688,9 @@ final class PhabricatorConfigDatabaseController
case PhabricatorConfigStorageSchema::STATUS_OKAY: case PhabricatorConfigStorageSchema::STATUS_OKAY:
$icon = 'fa-check-circle green'; $icon = 'fa-check-circle green';
break; break;
case PhabricatorConfigStorageSchema::STATUS_NOTE:
$icon = 'fa-info-circle blue';
break;
case PhabricatorConfigStorageSchema::STATUS_WARN: case PhabricatorConfigStorageSchema::STATUS_WARN:
$icon = 'fa-exclamation-circle yellow'; $icon = 'fa-exclamation-circle yellow';
break; break;
@ -735,6 +738,10 @@ final class PhabricatorConfigDatabaseController
$status = PhabricatorConfigStorageSchema::getIssueStatus($issue); $status = PhabricatorConfigStorageSchema::getIssueStatus($issue);
switch ($status) { switch ($status) {
case PhabricatorConfigStorageSchema::STATUS_NOTE:
$icon = PHUIStatusItemView::ICON_INFO;
$color = 'blue';
break;
case PhabricatorConfigStorageSchema::STATUS_WARN: case PhabricatorConfigStorageSchema::STATUS_WARN:
$icon = PHUIStatusItemView::ICON_WARNING; $icon = PHUIStatusItemView::ICON_WARNING;
$color = 'yellow'; $color = 'yellow';

View file

@ -74,6 +74,10 @@ abstract class PhabricatorConfigSchemaSpec extends Phobject {
$table = $this->newTable($table_name); $table = $this->newTable($table_name);
foreach ($columns as $name => $type) { foreach ($columns as $name => $type) {
if ($type === null) {
continue;
}
$details = $this->getDetailsForDataType($type); $details = $this->getDetailsForDataType($type);
list($column_type, $charset, $collation, $nullable) = $details; list($column_type, $charset, $collation, $nullable) = $details;

View file

@ -9,10 +9,12 @@ abstract class PhabricatorConfigStorageSchema extends Phobject {
const ISSUE_COLUMNTYPE = 'columntype'; const ISSUE_COLUMNTYPE = 'columntype';
const ISSUE_NULLABLE = 'nullable'; const ISSUE_NULLABLE = 'nullable';
const ISSUE_KEYCOLUMNS = 'keycolumns'; const ISSUE_KEYCOLUMNS = 'keycolumns';
const ISSUE_SUBNOTE = 'subnote';
const ISSUE_SUBWARN = 'subwarn'; const ISSUE_SUBWARN = 'subwarn';
const ISSUE_SUBFAIL = 'subfail'; const ISSUE_SUBFAIL = 'subfail';
const STATUS_OKAY = 'okay'; const STATUS_OKAY = 'okay';
const STATUS_NOTE = 'note';
const STATUS_WARN = 'warn'; const STATUS_WARN = 'warn';
const STATUS_FAIL = 'fail'; const STATUS_FAIL = 'fail';
@ -55,6 +57,9 @@ abstract class PhabricatorConfigStorageSchema extends Phobject {
foreach ($this->getSubschemata() as $sub) { foreach ($this->getSubschemata() as $sub) {
switch ($sub->getStatus()) { switch ($sub->getStatus()) {
case self::STATUS_NOTE:
$issues[self::ISSUE_SUBNOTE] = self::ISSUE_SUBNOTE;
break;
case self::STATUS_WARN: case self::STATUS_WARN:
$issues[self::ISSUE_SUBWARN] = self::ISSUE_SUBWARN; $issues[self::ISSUE_SUBWARN] = self::ISSUE_SUBWARN;
break; break;
@ -104,6 +109,8 @@ abstract class PhabricatorConfigStorageSchema extends Phobject {
return pht('Wrong Nullable Setting'); return pht('Wrong Nullable Setting');
case self::ISSUE_KEYCOLUMNS: case self::ISSUE_KEYCOLUMNS:
return pht('Key on Wrong Columns'); return pht('Key on Wrong Columns');
case self::ISSUE_SUBNOTE:
return pht('Subschemata Have Notices');
case self::ISSUE_SUBWARN: case self::ISSUE_SUBWARN:
return pht('Subschemata Have Warnings'); return pht('Subschemata Have Warnings');
case self::ISSUE_SUBFAIL: case self::ISSUE_SUBFAIL:
@ -129,6 +136,8 @@ abstract class PhabricatorConfigStorageSchema extends Phobject {
return pht('This schema has the wrong nullable setting.'); return pht('This schema has the wrong nullable setting.');
case self::ISSUE_KEYCOLUMNS: case self::ISSUE_KEYCOLUMNS:
return pht('This schema is on the wrong columns.'); return pht('This schema is on the wrong columns.');
case self::ISSUE_SUBNOTE:
return pht('Subschemata have setup notices.');
case self::ISSUE_SUBWARN: case self::ISSUE_SUBWARN:
return pht('Subschemata have setup warnings.'); return pht('Subschemata have setup warnings.');
case self::ISSUE_SUBFAIL: case self::ISSUE_SUBFAIL:
@ -144,13 +153,15 @@ abstract class PhabricatorConfigStorageSchema extends Phobject {
case self::ISSUE_SUBFAIL: case self::ISSUE_SUBFAIL:
return self::STATUS_FAIL; return self::STATUS_FAIL;
case self::ISSUE_SURPLUS: case self::ISSUE_SURPLUS:
case self::ISSUE_CHARSET:
case self::ISSUE_COLLATION:
case self::ISSUE_COLUMNTYPE: case self::ISSUE_COLUMNTYPE:
case self::ISSUE_SUBWARN: case self::ISSUE_SUBWARN:
case self::ISSUE_KEYCOLUMNS: case self::ISSUE_KEYCOLUMNS:
case self::ISSUE_NULLABLE: case self::ISSUE_NULLABLE:
return self::STATUS_WARN; return self::STATUS_WARN;
case self::ISSUE_SUBNOTE:
case self::ISSUE_CHARSET:
case self::ISSUE_COLLATION:
return self::STATUS_NOTE;
default: default:
throw new Exception(pht('Unknown schema issue "%s"!', $issue)); throw new Exception(pht('Unknown schema issue "%s"!', $issue));
} }
@ -159,8 +170,10 @@ abstract class PhabricatorConfigStorageSchema extends Phobject {
public static function getStatusSeverity($status) { public static function getStatusSeverity($status) {
switch ($status) { switch ($status) {
case self::STATUS_FAIL: case self::STATUS_FAIL:
return 2; return 3;
case self::STATUS_WARN: case self::STATUS_WARN:
return 2;
case self::STATUS_NOTE:
return 1; return 1;
case self::STATUS_OKAY: case self::STATUS_OKAY:
return 0; return 0;

View file

@ -39,7 +39,11 @@ final class PhabricatorDashboard extends PhabricatorDashboardDAO
return array( return array(
self::CONFIG_AUX_PHID => true, self::CONFIG_AUX_PHID => true,
self::CONFIG_SERIALIZATION => array( self::CONFIG_SERIALIZATION => array(
'layoutConfig' => self::SERIALIZATION_JSON), 'layoutConfig' => self::SERIALIZATION_JSON,
),
self::CONFIG_COLUMN_SCHEMA => array(
'name' => 'text255',
),
) + parent::getConfiguration(); ) + parent::getConfiguration();
} }

View file

@ -14,6 +14,19 @@ final class PhabricatorDashboardInstall
protected $applicationClass; protected $applicationClass;
protected $dashboardPHID; protected $dashboardPHID;
public function getConfiguration() {
return array(
self::CONFIG_COLUMN_SCHEMA => array(
'applicationClass' => 'text64',
),
self::CONFIG_KEY_SCHEMA => array(
'objectPHID' => array(
'columns' => array('objectPHID', 'applicationClass'),
),
),
) + parent::getConfiguration();
}
public static function getDashboard( public static function getDashboard(
PhabricatorUser $viewer, PhabricatorUser $viewer,
$object_phid, $object_phid,

View file

@ -43,6 +43,11 @@ final class PhabricatorDashboardPanel
self::CONFIG_SERIALIZATION => array( self::CONFIG_SERIALIZATION => array(
'properties' => self::SERIALIZATION_JSON, 'properties' => self::SERIALIZATION_JSON,
), ),
self::CONFIG_COLUMN_SCHEMA => array(
'name' => 'text255',
'panelType' => 'text64',
'isArchived' => 'bool',
),
) + parent::getConfiguration(); ) + parent::getConfiguration();
} }

View file

@ -19,6 +19,20 @@ final class DoorkeeperExternalObject extends DoorkeeperDAO
self::CONFIG_SERIALIZATION => array( self::CONFIG_SERIALIZATION => array(
'properties' => self::SERIALIZATION_JSON, 'properties' => self::SERIALIZATION_JSON,
), ),
self::CONFIG_COLUMN_SCHEMA => array(
'objectKey' => 'bytes12',
'applicationType' => 'text32',
'applicationDomain' => 'text32',
'objectType' => 'text32',
'objectID' => 'text64',
'objectURI' => 'text128?',
'importerPHID' => 'phid?',
),
self::CONFIG_KEY_SCHEMA => array(
'key_object' => array(
'columns' => array('objectKey'),
),
),
) + parent::getConfiguration(); ) + parent::getConfiguration();
} }

View file

@ -0,0 +1,12 @@
<?php
final class DoorkeeperSchemaSpec
extends PhabricatorConfigSchemaSpec {
public function buildSchemata() {
$this->buildLiskSchemata('DoorkeeperDAO');
$this->buildEdgeSchemata(new DoorkeeperExternalObject());
}
}

View file

@ -14,6 +14,15 @@ final class PhabricatorDraft extends PhabricatorDraftDAO {
self::CONFIG_SERIALIZATION => array( self::CONFIG_SERIALIZATION => array(
'metadata' => self::SERIALIZATION_JSON, 'metadata' => self::SERIALIZATION_JSON,
), ),
self::CONFIG_COLUMN_SCHEMA => array(
'draftKey' => 'text64',
'draft' => 'text',
),
self::CONFIG_KEY_SCHEMA => array(
'authorPHID' => array(
'columns' => array('authorPHID', 'draftKey'),
),
),
) + parent::getConfiguration(); ) + parent::getConfiguration();
} }

View file

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

View file

@ -36,7 +36,11 @@ final class DrydockBlueprint extends DrydockDAO
self::CONFIG_AUX_PHID => true, self::CONFIG_AUX_PHID => true,
self::CONFIG_SERIALIZATION => array( self::CONFIG_SERIALIZATION => array(
'details' => self::SERIALIZATION_JSON, 'details' => self::SERIALIZATION_JSON,
) ),
self::CONFIG_COLUMN_SCHEMA => array(
'className' => 'text255',
'blueprintName' => 'text255',
),
) + parent::getConfiguration(); ) + parent::getConfiguration();
} }

View file

@ -43,6 +43,20 @@ final class DrydockLease extends DrydockDAO
self::CONFIG_SERIALIZATION => array( self::CONFIG_SERIALIZATION => array(
'attributes' => self::SERIALIZATION_JSON, 'attributes' => self::SERIALIZATION_JSON,
), ),
self::CONFIG_COLUMN_SCHEMA => array(
'status' => 'uint32',
'until' => 'epoch?',
'resourceType' => 'text128',
'taskID' => 'id?',
'ownerPHID' => 'phid?',
'resourceID' => 'id?',
),
self::CONFIG_KEY_SCHEMA => array(
'key_phid' => null,
'phid' => array(
'columns' => array('phid'),
),
),
) + parent::getConfiguration(); ) + parent::getConfiguration();
} }

View file

@ -14,6 +14,11 @@ final class DrydockLog extends DrydockDAO
public function getConfiguration() { public function getConfiguration() {
return array( return array(
self::CONFIG_TIMESTAMPS => false, self::CONFIG_TIMESTAMPS => false,
self::CONFIG_COLUMN_SCHEMA => array(
'resourceID' => 'id?',
'leaseID' => 'id?',
'message' => 'text',
),
) + parent::getConfiguration(); ) + parent::getConfiguration();
} }

View file

@ -23,6 +23,18 @@ final class DrydockResource extends DrydockDAO
'attributes' => self::SERIALIZATION_JSON, 'attributes' => self::SERIALIZATION_JSON,
'capabilities' => self::SERIALIZATION_JSON, 'capabilities' => self::SERIALIZATION_JSON,
), ),
self::CONFIG_COLUMN_SCHEMA => array(
'name' => 'text255',
'ownerPHID' => 'phid?',
'status' => 'uint32',
'type' => 'text64',
),
self::CONFIG_KEY_SCHEMA => array(
'key_phid' => null,
'phid' => array(
'columns' => array('phid'),
),
),
) + parent::getConfiguration(); ) + parent::getConfiguration();
} }

View file

@ -0,0 +1,14 @@
<?php
final class DrydockSchemaSpec
extends PhabricatorConfigSchemaSpec {
public function buildSchemata() {
$this->buildLiskSchemata('DrydockDAO');
$this->buildTransactionSchema(
new DrydockBlueprintTransaction());
}
}

View file

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

View file

@ -15,6 +15,19 @@ final class PhabricatorFeedStoryData extends PhabricatorFeedDAO {
self::CONFIG_SERIALIZATION => array( self::CONFIG_SERIALIZATION => array(
'storyData' => self::SERIALIZATION_JSON, 'storyData' => self::SERIALIZATION_JSON,
), ),
self::CONFIG_COLUMN_SCHEMA => array(
'chronologicalKey' => 'uint64',
'storyType' => 'text64',
),
self::CONFIG_KEY_SCHEMA => array(
'key_phid' => null,
'phid' => array(
'columns' => array('phid'),
),
'chronologicalKey' => array(
'columns' => array('chronologicalKey'),
),
),
) + parent::getConfiguration(); ) + parent::getConfiguration();
} }

View file

@ -9,6 +9,16 @@ final class PhabricatorFeedStoryReference extends PhabricatorFeedDAO {
return array( return array(
self::CONFIG_IDS => self::IDS_MANUAL, self::CONFIG_IDS => self::IDS_MANUAL,
self::CONFIG_TIMESTAMPS => false, self::CONFIG_TIMESTAMPS => false,
self::CONFIG_COLUMN_SCHEMA => array(
'chronologicalKey' => 'uint64',
'id' => null,
),
self::CONFIG_KEY_SCHEMA => array(
'PRIMARY' => null,
'objectPHID' => array(
'columns' => array('objectPHID', 'chronologicalKey'),
),
),
) + parent::getConfiguration(); ) + parent::getConfiguration();
} }

View file

@ -11,6 +11,17 @@ final class PhabricatorFeedStoryNotification extends PhabricatorFeedDAO {
return array( return array(
self::CONFIG_IDS => self::IDS_MANUAL, self::CONFIG_IDS => self::IDS_MANUAL,
self::CONFIG_TIMESTAMPS => false, self::CONFIG_TIMESTAMPS => false,
self::CONFIG_COLUMN_SCHEMA => array(
'chronologicalKey' => 'uint64',
'hasViewed' => 'bool',
'id' => null,
),
self::CONFIG_KEY_SCHEMA => array(
'PRIMARY' => null,
'userPHID' => array(
'columns' => array('userPHID', 'chronologicalKey'),
),
),
) + parent::getConfiguration(); ) + parent::getConfiguration();
} }

View file

@ -1750,9 +1750,8 @@ abstract class LiskDAO {
$map = array(); $map = array();
foreach ($this->getAllLiskProperties() as $property) { foreach ($this->getAllLiskProperties() as $property) {
// First, use types specified explicitly in the table configuration. // First, use types specified explicitly in the table configuration.
$type = idx($custom_map, $property); if (array_key_exists($property, $custom_map)) {
if ($type) { $map[$property] = $custom_map[$property];
$map[$property] = $type;
continue; continue;
} }
@ -1786,7 +1785,7 @@ abstract class LiskDAO {
} }
// We don't know the type of this column. // We don't know the type of this column.
$map[$property] = null; $map[$property] = '<unknown>';
} }
return $map; return $map;