From 67fbfe6ccc9f511328c6230adff966610d7c055c Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 18 Sep 2014 11:15:49 -0700 Subject: [PATCH] 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 --- src/__phutil_library_map__.php | 8 ++++++++ .../storage/PhabricatorAuthProviderConfig.php | 3 +++ .../PhabricatorConfigDatabaseController.php | 7 +++++++ .../schema/PhabricatorConfigSchemaSpec.php | 4 ++++ .../schema/PhabricatorConfigStorageSchema.php | 19 ++++++++++++++++--- .../storage/PhabricatorDashboard.php | 6 +++++- .../storage/PhabricatorDashboardInstall.php | 13 +++++++++++++ .../storage/PhabricatorDashboardPanel.php | 5 +++++ .../storage/DoorkeeperExternalObject.php | 14 ++++++++++++++ .../storage/DoorkeeperSchemaSpec.php | 12 ++++++++++++ .../draft/storage/PhabricatorDraft.php | 9 +++++++++ .../storage/PhabricatorDraftSchemaSpec.php | 10 ++++++++++ .../drydock/storage/DrydockBlueprint.php | 6 +++++- .../drydock/storage/DrydockLease.php | 14 ++++++++++++++ .../drydock/storage/DrydockLog.php | 5 +++++ .../drydock/storage/DrydockResource.php | 12 ++++++++++++ .../drydock/storage/DrydockSchemaSpec.php | 14 ++++++++++++++ .../storage/PhabricatorFeedSchemaSpec.php | 10 ++++++++++ .../feed/storage/PhabricatorFeedStoryData.php | 13 +++++++++++++ .../storage/PhabricatorFeedStoryReference.php | 10 ++++++++++ .../PhabricatorFeedStoryNotification.php | 11 +++++++++++ src/infrastructure/storage/lisk/LiskDAO.php | 7 +++---- 22 files changed, 203 insertions(+), 9 deletions(-) create mode 100644 src/applications/doorkeeper/storage/DoorkeeperSchemaSpec.php create mode 100644 src/applications/draft/storage/PhabricatorDraftSchemaSpec.php create mode 100644 src/applications/drydock/storage/DrydockSchemaSpec.php create mode 100644 src/applications/feed/storage/PhabricatorFeedSchemaSpec.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 0f0672b20b..e914aa23e6 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -570,6 +570,7 @@ phutil_register_library_map(array( 'DoorkeeperRemarkupRule' => 'applications/doorkeeper/remarkup/DoorkeeperRemarkupRule.php', 'DoorkeeperRemarkupRuleAsana' => 'applications/doorkeeper/remarkup/DoorkeeperRemarkupRuleAsana.php', 'DoorkeeperRemarkupRuleJIRA' => 'applications/doorkeeper/remarkup/DoorkeeperRemarkupRuleJIRA.php', + 'DoorkeeperSchemaSpec' => 'applications/doorkeeper/storage/DoorkeeperSchemaSpec.php', 'DoorkeeperTagView' => 'applications/doorkeeper/view/DoorkeeperTagView.php', 'DoorkeeperTagsController' => 'applications/doorkeeper/controller/DoorkeeperTagsController.php', 'DrydockAllocatorWorker' => 'applications/drydock/worker/DrydockAllocatorWorker.php', @@ -636,6 +637,7 @@ phutil_register_library_map(array( 'DrydockResourceViewController' => 'applications/drydock/controller/DrydockResourceViewController.php', 'DrydockSFTPFilesystemInterface' => 'applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php', 'DrydockSSHCommandInterface' => 'applications/drydock/interface/command/DrydockSSHCommandInterface.php', + 'DrydockSchemaSpec' => 'applications/drydock/storage/DrydockSchemaSpec.php', 'DrydockWebrootInterface' => 'applications/drydock/interface/webroot/DrydockWebrootInterface.php', 'DrydockWorkingCopyBlueprintImplementation' => 'applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php', 'FeedConduitAPIMethod' => 'applications/feed/conduit/FeedConduitAPIMethod.php', @@ -1514,6 +1516,7 @@ phutil_register_library_map(array( 'PhabricatorDoorkeeperApplication' => 'applications/doorkeeper/application/PhabricatorDoorkeeperApplication.php', 'PhabricatorDraft' => 'applications/draft/storage/PhabricatorDraft.php', 'PhabricatorDraftDAO' => 'applications/draft/storage/PhabricatorDraftDAO.php', + 'PhabricatorDraftSchemaSpec' => 'applications/draft/storage/PhabricatorDraftSchemaSpec.php', 'PhabricatorDrydockApplication' => 'applications/drydock/application/PhabricatorDrydockApplication.php', 'PhabricatorEdgeConfig' => 'infrastructure/edges/constants/PhabricatorEdgeConfig.php', 'PhabricatorEdgeConstants' => 'infrastructure/edges/constants/PhabricatorEdgeConstants.php', @@ -1574,6 +1577,7 @@ phutil_register_library_map(array( 'PhabricatorFeedManagementWorkflow' => 'applications/feed/management/PhabricatorFeedManagementWorkflow.php', 'PhabricatorFeedPublicStreamController' => 'applications/feed/controller/PhabricatorFeedPublicStreamController.php', 'PhabricatorFeedQuery' => 'applications/feed/query/PhabricatorFeedQuery.php', + 'PhabricatorFeedSchemaSpec' => 'applications/feed/storage/PhabricatorFeedSchemaSpec.php', 'PhabricatorFeedSearchEngine' => 'applications/feed/query/PhabricatorFeedSearchEngine.php', 'PhabricatorFeedStory' => 'applications/feed/story/PhabricatorFeedStory.php', 'PhabricatorFeedStoryAggregate' => 'applications/feed/story/PhabricatorFeedStoryAggregate.php', @@ -3373,6 +3377,7 @@ phutil_register_library_map(array( 'DoorkeeperRemarkupRule' => 'PhutilRemarkupRule', 'DoorkeeperRemarkupRuleAsana' => 'DoorkeeperRemarkupRule', 'DoorkeeperRemarkupRuleJIRA' => 'DoorkeeperRemarkupRule', + 'DoorkeeperSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'DoorkeeperTagView' => 'AphrontView', 'DoorkeeperTagsController' => 'PhabricatorController', 'DrydockAllocatorWorker' => 'PhabricatorWorker', @@ -3451,6 +3456,7 @@ phutil_register_library_map(array( 'DrydockResourceViewController' => 'DrydockResourceController', 'DrydockSFTPFilesystemInterface' => 'DrydockFilesystemInterface', 'DrydockSSHCommandInterface' => 'DrydockCommandInterface', + 'DrydockSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'DrydockWebrootInterface' => 'DrydockInterface', 'DrydockWorkingCopyBlueprintImplementation' => 'DrydockBlueprintImplementation', 'FeedConduitAPIMethod' => 'ConduitAPIMethod', @@ -4430,6 +4436,7 @@ phutil_register_library_map(array( 'PhabricatorDoorkeeperApplication' => 'PhabricatorApplication', 'PhabricatorDraft' => 'PhabricatorDraftDAO', 'PhabricatorDraftDAO' => 'PhabricatorLiskDAO', + 'PhabricatorDraftSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorDrydockApplication' => 'PhabricatorApplication', 'PhabricatorEdgeConfig' => 'PhabricatorEdgeConstants', 'PhabricatorEdgeCycleException' => 'Exception', @@ -4486,6 +4493,7 @@ phutil_register_library_map(array( 'PhabricatorFeedManagementWorkflow' => 'PhabricatorManagementWorkflow', 'PhabricatorFeedPublicStreamController' => 'PhabricatorFeedController', 'PhabricatorFeedQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', + 'PhabricatorFeedSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorFeedSearchEngine' => 'PhabricatorApplicationSearchEngine', 'PhabricatorFeedStory' => array( 'PhabricatorPolicyInterface', diff --git a/src/applications/auth/storage/PhabricatorAuthProviderConfig.php b/src/applications/auth/storage/PhabricatorAuthProviderConfig.php index 5055b8878a..7dd425f477 100644 --- a/src/applications/auth/storage/PhabricatorAuthProviderConfig.php +++ b/src/applications/auth/storage/PhabricatorAuthProviderConfig.php @@ -31,6 +31,9 @@ final class PhabricatorAuthProviderConfig extends PhabricatorAuthDAO ), self::CONFIG_COLUMN_SCHEMA => array( 'isEnabled' => 'bool', + 'providerClass' => 'text128', + 'providerType' => 'text64', + 'providerDomain' => 'text128', 'shouldAllowLogin' => 'bool', 'shouldAllowRegistration' => 'bool', 'shouldAllowLink' => 'bool', diff --git a/src/applications/config/controller/PhabricatorConfigDatabaseController.php b/src/applications/config/controller/PhabricatorConfigDatabaseController.php index c8e42b1a8c..406bdda79c 100644 --- a/src/applications/config/controller/PhabricatorConfigDatabaseController.php +++ b/src/applications/config/controller/PhabricatorConfigDatabaseController.php @@ -688,6 +688,9 @@ final class PhabricatorConfigDatabaseController case PhabricatorConfigStorageSchema::STATUS_OKAY: $icon = 'fa-check-circle green'; break; + case PhabricatorConfigStorageSchema::STATUS_NOTE: + $icon = 'fa-info-circle blue'; + break; case PhabricatorConfigStorageSchema::STATUS_WARN: $icon = 'fa-exclamation-circle yellow'; break; @@ -735,6 +738,10 @@ final class PhabricatorConfigDatabaseController $status = PhabricatorConfigStorageSchema::getIssueStatus($issue); switch ($status) { + case PhabricatorConfigStorageSchema::STATUS_NOTE: + $icon = PHUIStatusItemView::ICON_INFO; + $color = 'blue'; + break; case PhabricatorConfigStorageSchema::STATUS_WARN: $icon = PHUIStatusItemView::ICON_WARNING; $color = 'yellow'; diff --git a/src/applications/config/schema/PhabricatorConfigSchemaSpec.php b/src/applications/config/schema/PhabricatorConfigSchemaSpec.php index 32818a127d..a7bf3ef512 100644 --- a/src/applications/config/schema/PhabricatorConfigSchemaSpec.php +++ b/src/applications/config/schema/PhabricatorConfigSchemaSpec.php @@ -74,6 +74,10 @@ abstract class PhabricatorConfigSchemaSpec extends Phobject { $table = $this->newTable($table_name); foreach ($columns as $name => $type) { + if ($type === null) { + continue; + } + $details = $this->getDetailsForDataType($type); list($column_type, $charset, $collation, $nullable) = $details; diff --git a/src/applications/config/schema/PhabricatorConfigStorageSchema.php b/src/applications/config/schema/PhabricatorConfigStorageSchema.php index 6e0ddc5814..66a3e38464 100644 --- a/src/applications/config/schema/PhabricatorConfigStorageSchema.php +++ b/src/applications/config/schema/PhabricatorConfigStorageSchema.php @@ -9,10 +9,12 @@ abstract class PhabricatorConfigStorageSchema extends Phobject { const ISSUE_COLUMNTYPE = 'columntype'; const ISSUE_NULLABLE = 'nullable'; const ISSUE_KEYCOLUMNS = 'keycolumns'; + const ISSUE_SUBNOTE = 'subnote'; const ISSUE_SUBWARN = 'subwarn'; const ISSUE_SUBFAIL = 'subfail'; const STATUS_OKAY = 'okay'; + const STATUS_NOTE = 'note'; const STATUS_WARN = 'warn'; const STATUS_FAIL = 'fail'; @@ -55,6 +57,9 @@ abstract class PhabricatorConfigStorageSchema extends Phobject { foreach ($this->getSubschemata() as $sub) { switch ($sub->getStatus()) { + case self::STATUS_NOTE: + $issues[self::ISSUE_SUBNOTE] = self::ISSUE_SUBNOTE; + break; case self::STATUS_WARN: $issues[self::ISSUE_SUBWARN] = self::ISSUE_SUBWARN; break; @@ -104,6 +109,8 @@ abstract class PhabricatorConfigStorageSchema extends Phobject { return pht('Wrong Nullable Setting'); case self::ISSUE_KEYCOLUMNS: return pht('Key on Wrong Columns'); + case self::ISSUE_SUBNOTE: + return pht('Subschemata Have Notices'); case self::ISSUE_SUBWARN: return pht('Subschemata Have Warnings'); case self::ISSUE_SUBFAIL: @@ -129,6 +136,8 @@ abstract class PhabricatorConfigStorageSchema extends Phobject { return pht('This schema has the wrong nullable setting.'); case self::ISSUE_KEYCOLUMNS: return pht('This schema is on the wrong columns.'); + case self::ISSUE_SUBNOTE: + return pht('Subschemata have setup notices.'); case self::ISSUE_SUBWARN: return pht('Subschemata have setup warnings.'); case self::ISSUE_SUBFAIL: @@ -144,13 +153,15 @@ abstract class PhabricatorConfigStorageSchema extends Phobject { case self::ISSUE_SUBFAIL: return self::STATUS_FAIL; case self::ISSUE_SURPLUS: - case self::ISSUE_CHARSET: - case self::ISSUE_COLLATION: case self::ISSUE_COLUMNTYPE: case self::ISSUE_SUBWARN: case self::ISSUE_KEYCOLUMNS: case self::ISSUE_NULLABLE: return self::STATUS_WARN; + case self::ISSUE_SUBNOTE: + case self::ISSUE_CHARSET: + case self::ISSUE_COLLATION: + return self::STATUS_NOTE; default: throw new Exception(pht('Unknown schema issue "%s"!', $issue)); } @@ -159,8 +170,10 @@ abstract class PhabricatorConfigStorageSchema extends Phobject { public static function getStatusSeverity($status) { switch ($status) { case self::STATUS_FAIL: - return 2; + return 3; case self::STATUS_WARN: + return 2; + case self::STATUS_NOTE: return 1; case self::STATUS_OKAY: return 0; diff --git a/src/applications/dashboard/storage/PhabricatorDashboard.php b/src/applications/dashboard/storage/PhabricatorDashboard.php index 3beb71b775..e2501c3756 100644 --- a/src/applications/dashboard/storage/PhabricatorDashboard.php +++ b/src/applications/dashboard/storage/PhabricatorDashboard.php @@ -39,7 +39,11 @@ final class PhabricatorDashboard extends PhabricatorDashboardDAO return array( self::CONFIG_AUX_PHID => true, self::CONFIG_SERIALIZATION => array( - 'layoutConfig' => self::SERIALIZATION_JSON), + 'layoutConfig' => self::SERIALIZATION_JSON, + ), + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text255', + ), ) + parent::getConfiguration(); } diff --git a/src/applications/dashboard/storage/PhabricatorDashboardInstall.php b/src/applications/dashboard/storage/PhabricatorDashboardInstall.php index 8d59d45c52..0064beb8bd 100644 --- a/src/applications/dashboard/storage/PhabricatorDashboardInstall.php +++ b/src/applications/dashboard/storage/PhabricatorDashboardInstall.php @@ -14,6 +14,19 @@ final class PhabricatorDashboardInstall protected $applicationClass; 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( PhabricatorUser $viewer, $object_phid, diff --git a/src/applications/dashboard/storage/PhabricatorDashboardPanel.php b/src/applications/dashboard/storage/PhabricatorDashboardPanel.php index 5c32a14165..555c370617 100644 --- a/src/applications/dashboard/storage/PhabricatorDashboardPanel.php +++ b/src/applications/dashboard/storage/PhabricatorDashboardPanel.php @@ -43,6 +43,11 @@ final class PhabricatorDashboardPanel self::CONFIG_SERIALIZATION => array( 'properties' => self::SERIALIZATION_JSON, ), + self::CONFIG_COLUMN_SCHEMA => array( + 'name' => 'text255', + 'panelType' => 'text64', + 'isArchived' => 'bool', + ), ) + parent::getConfiguration(); } diff --git a/src/applications/doorkeeper/storage/DoorkeeperExternalObject.php b/src/applications/doorkeeper/storage/DoorkeeperExternalObject.php index 0b1934d360..ce0a4f5eae 100644 --- a/src/applications/doorkeeper/storage/DoorkeeperExternalObject.php +++ b/src/applications/doorkeeper/storage/DoorkeeperExternalObject.php @@ -19,6 +19,20 @@ final class DoorkeeperExternalObject extends DoorkeeperDAO self::CONFIG_SERIALIZATION => array( '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(); } diff --git a/src/applications/doorkeeper/storage/DoorkeeperSchemaSpec.php b/src/applications/doorkeeper/storage/DoorkeeperSchemaSpec.php new file mode 100644 index 0000000000..1ca51996f0 --- /dev/null +++ b/src/applications/doorkeeper/storage/DoorkeeperSchemaSpec.php @@ -0,0 +1,12 @@ +buildLiskSchemata('DoorkeeperDAO'); + + $this->buildEdgeSchemata(new DoorkeeperExternalObject()); + } + +} diff --git a/src/applications/draft/storage/PhabricatorDraft.php b/src/applications/draft/storage/PhabricatorDraft.php index 5b6a6e1aee..e8d3748431 100644 --- a/src/applications/draft/storage/PhabricatorDraft.php +++ b/src/applications/draft/storage/PhabricatorDraft.php @@ -14,6 +14,15 @@ final class PhabricatorDraft extends PhabricatorDraftDAO { self::CONFIG_SERIALIZATION => array( '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(); } diff --git a/src/applications/draft/storage/PhabricatorDraftSchemaSpec.php b/src/applications/draft/storage/PhabricatorDraftSchemaSpec.php new file mode 100644 index 0000000000..ea974bcc30 --- /dev/null +++ b/src/applications/draft/storage/PhabricatorDraftSchemaSpec.php @@ -0,0 +1,10 @@ +buildLiskSchemata('PhabricatorDraftDAO'); + } + +} diff --git a/src/applications/drydock/storage/DrydockBlueprint.php b/src/applications/drydock/storage/DrydockBlueprint.php index 4e6ccb1681..8d8f91cfa2 100644 --- a/src/applications/drydock/storage/DrydockBlueprint.php +++ b/src/applications/drydock/storage/DrydockBlueprint.php @@ -36,7 +36,11 @@ final class DrydockBlueprint extends DrydockDAO self::CONFIG_AUX_PHID => true, self::CONFIG_SERIALIZATION => array( 'details' => self::SERIALIZATION_JSON, - ) + ), + self::CONFIG_COLUMN_SCHEMA => array( + 'className' => 'text255', + 'blueprintName' => 'text255', + ), ) + parent::getConfiguration(); } diff --git a/src/applications/drydock/storage/DrydockLease.php b/src/applications/drydock/storage/DrydockLease.php index fd3d2b0e88..6a971629e8 100644 --- a/src/applications/drydock/storage/DrydockLease.php +++ b/src/applications/drydock/storage/DrydockLease.php @@ -43,6 +43,20 @@ final class DrydockLease extends DrydockDAO self::CONFIG_SERIALIZATION => array( '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(); } diff --git a/src/applications/drydock/storage/DrydockLog.php b/src/applications/drydock/storage/DrydockLog.php index a34114e321..1faa6f9bc4 100644 --- a/src/applications/drydock/storage/DrydockLog.php +++ b/src/applications/drydock/storage/DrydockLog.php @@ -14,6 +14,11 @@ final class DrydockLog extends DrydockDAO public function getConfiguration() { return array( self::CONFIG_TIMESTAMPS => false, + self::CONFIG_COLUMN_SCHEMA => array( + 'resourceID' => 'id?', + 'leaseID' => 'id?', + 'message' => 'text', + ), ) + parent::getConfiguration(); } diff --git a/src/applications/drydock/storage/DrydockResource.php b/src/applications/drydock/storage/DrydockResource.php index 6db5c0d5b6..0ad17d303f 100644 --- a/src/applications/drydock/storage/DrydockResource.php +++ b/src/applications/drydock/storage/DrydockResource.php @@ -23,6 +23,18 @@ final class DrydockResource extends DrydockDAO 'attributes' => 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(); } diff --git a/src/applications/drydock/storage/DrydockSchemaSpec.php b/src/applications/drydock/storage/DrydockSchemaSpec.php new file mode 100644 index 0000000000..af7168d0d4 --- /dev/null +++ b/src/applications/drydock/storage/DrydockSchemaSpec.php @@ -0,0 +1,14 @@ +buildLiskSchemata('DrydockDAO'); + + $this->buildTransactionSchema( + new DrydockBlueprintTransaction()); + + } + +} diff --git a/src/applications/feed/storage/PhabricatorFeedSchemaSpec.php b/src/applications/feed/storage/PhabricatorFeedSchemaSpec.php new file mode 100644 index 0000000000..b8a2bba75b --- /dev/null +++ b/src/applications/feed/storage/PhabricatorFeedSchemaSpec.php @@ -0,0 +1,10 @@ +buildLiskSchemata('PhabricatorFeedDAO'); + } + +} diff --git a/src/applications/feed/storage/PhabricatorFeedStoryData.php b/src/applications/feed/storage/PhabricatorFeedStoryData.php index 3f9f3504d2..161d8fe896 100644 --- a/src/applications/feed/storage/PhabricatorFeedStoryData.php +++ b/src/applications/feed/storage/PhabricatorFeedStoryData.php @@ -15,6 +15,19 @@ final class PhabricatorFeedStoryData extends PhabricatorFeedDAO { self::CONFIG_SERIALIZATION => array( '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(); } diff --git a/src/applications/feed/storage/PhabricatorFeedStoryReference.php b/src/applications/feed/storage/PhabricatorFeedStoryReference.php index 64e0533375..f4b980a4a0 100644 --- a/src/applications/feed/storage/PhabricatorFeedStoryReference.php +++ b/src/applications/feed/storage/PhabricatorFeedStoryReference.php @@ -9,6 +9,16 @@ final class PhabricatorFeedStoryReference extends PhabricatorFeedDAO { return array( self::CONFIG_IDS => self::IDS_MANUAL, 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(); } diff --git a/src/applications/notification/storage/PhabricatorFeedStoryNotification.php b/src/applications/notification/storage/PhabricatorFeedStoryNotification.php index 47846418c4..dd500bb0d3 100644 --- a/src/applications/notification/storage/PhabricatorFeedStoryNotification.php +++ b/src/applications/notification/storage/PhabricatorFeedStoryNotification.php @@ -11,6 +11,17 @@ final class PhabricatorFeedStoryNotification extends PhabricatorFeedDAO { return array( self::CONFIG_IDS => self::IDS_MANUAL, 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(); } diff --git a/src/infrastructure/storage/lisk/LiskDAO.php b/src/infrastructure/storage/lisk/LiskDAO.php index 0e122ba55a..77d54cf6fa 100644 --- a/src/infrastructure/storage/lisk/LiskDAO.php +++ b/src/infrastructure/storage/lisk/LiskDAO.php @@ -1750,9 +1750,8 @@ abstract class LiskDAO { $map = array(); foreach ($this->getAllLiskProperties() as $property) { // First, use types specified explicitly in the table configuration. - $type = idx($custom_map, $property); - if ($type) { - $map[$property] = $type; + if (array_key_exists($property, $custom_map)) { + $map[$property] = $custom_map[$property]; continue; } @@ -1786,7 +1785,7 @@ abstract class LiskDAO { } // We don't know the type of this column. - $map[$property] = null; + $map[$property] = ''; } return $map;