From 4f87adc4384685942a788da43214f4e4a72ce63d Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 1 Oct 2014 07:55:09 -0700 Subject: [PATCH] Ignore keys with trailing index on table primary key for now Summary: Ref T1191. We have several keys on ``. When `id` is an auto-increment primary key, I believe this is exactly equivalent to a key on ``, because the leaf nodes are implicitly sorted by `id`. We omit the implicit `id` elsewhere. It would be nice to drop the `id` bit for consistency, but it's not doing any harm and this doesn't need to block the primary work of T1191. Test Plan: Saw slightly fewer warnings. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T1191 Differential Revision: https://secure.phabricator.com/D10592 --- .../config/schema/PhabricatorConfigStorageSchema.php | 4 ++-- src/applications/nuance/storage/NuanceItem.php | 6 +++--- src/applications/nuance/storage/NuanceQueueItem.php | 7 ++++++- src/applications/phame/storage/PhamePost.php | 7 ++++++- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/applications/config/schema/PhabricatorConfigStorageSchema.php b/src/applications/config/schema/PhabricatorConfigStorageSchema.php index 8b59d8f1fe..e1c8bda4cd 100644 --- a/src/applications/config/schema/PhabricatorConfigStorageSchema.php +++ b/src/applications/config/schema/PhabricatorConfigStorageSchema.php @@ -169,12 +169,11 @@ abstract class PhabricatorConfigStorageSchema extends Phobject { public static function getIssueStatus($issue) { switch ($issue) { case self::ISSUE_MISSING: - case self::ISSUE_SUBFAIL: case self::ISSUE_SURPLUS: + case self::ISSUE_SUBFAIL: return self::STATUS_FAIL; case self::ISSUE_SUBWARN: case self::ISSUE_COLUMNTYPE: - case self::ISSUE_KEYCOLUMNS: case self::ISSUE_NULLABLE: return self::STATUS_WARN; case self::ISSUE_SUBNOTE: @@ -183,6 +182,7 @@ abstract class PhabricatorConfigStorageSchema extends Phobject { case self::ISSUE_MISSINGKEY: case self::ISSUE_SURPLUSKEY: case self::ISSUE_UNIQUE: + case self::ISSUE_KEYCOLUMNS: return self::STATUS_NOTE; default: throw new Exception(pht('Unknown schema issue "%s"!', $issue)); diff --git a/src/applications/nuance/storage/NuanceItem.php b/src/applications/nuance/storage/NuanceItem.php index fe02f7679a..f27151e786 100644 --- a/src/applications/nuance/storage/NuanceItem.php +++ b/src/applications/nuance/storage/NuanceItem.php @@ -38,13 +38,13 @@ final class NuanceItem ), self::CONFIG_KEY_SCHEMA => array( 'key_source' => array( - 'columns' => array('sourcePHID', 'status', 'dateNuanced'), + 'columns' => array('sourcePHID', 'status', 'dateNuanced', 'id'), ), 'key_owner' => array( - 'columns' => array('ownerPHID', 'status', 'dateNuanced'), + 'columns' => array('ownerPHID', 'status', 'dateNuanced', 'id'), ), 'key_contacter' => array( - 'columns' => array('requestorPHID', 'status', 'dateNuanced'), + 'columns' => array('requestorPHID', 'status', 'dateNuanced', 'id'), ), ), ) + parent::getConfiguration(); diff --git a/src/applications/nuance/storage/NuanceQueueItem.php b/src/applications/nuance/storage/NuanceQueueItem.php index 3fbaecd099..027ed99e69 100644 --- a/src/applications/nuance/storage/NuanceQueueItem.php +++ b/src/applications/nuance/storage/NuanceQueueItem.php @@ -20,7 +20,12 @@ final class NuanceQueueItem 'unique' => true, ), 'key_queue' => array( - 'columns' => array('queuePHID', 'itemStatus', 'itemDateNuanced'), + 'columns' => array( + 'queuePHID', + 'itemStatus', + 'itemDateNuanced', + 'id', + ), ), ), ) + parent::getConfiguration(); diff --git a/src/applications/phame/storage/PhamePost.php b/src/applications/phame/storage/PhamePost.php index bef665b7d6..ee98628e70 100644 --- a/src/applications/phame/storage/PhamePost.php +++ b/src/applications/phame/storage/PhamePost.php @@ -106,7 +106,12 @@ final class PhamePost extends PhameDAO 'unique' => true, ), 'bloggerPosts' => array( - 'columns' => array('bloggerPHID', 'visibility', 'datePublished'), + 'columns' => array( + 'bloggerPHID', + 'visibility', + 'datePublished', + 'id', + ), ), ), ) + parent::getConfiguration();