aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPIndexesController.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-04-16 20:16:52 +0000
committerstuconnolly <stuart02@gmail.com>2012-04-16 20:16:52 +0000
commit4cad6f0e6e4fb497b480256c2abe3de34ebf225c (patch)
treeb66d6a72a1537cf98624acf3c685f1a4d916fd86 /Source/SPIndexesController.m
parent0d3b69f964a8d9d93ca794d457b461463f1ec95d (diff)
downloadsequelpro-4cad6f0e6e4fb497b480256c2abe3de34ebf225c.tar.gz
sequelpro-4cad6f0e6e4fb497b480256c2abe3de34ebf225c.tar.bz2
sequelpro-4cad6f0e6e4fb497b480256c2abe3de34ebf225c.zip
Bring outline view branch up to date with trunk.
Diffstat (limited to 'Source/SPIndexesController.m')
-rw-r--r--Source/SPIndexesController.m19
1 files changed, 2 insertions, 17 deletions
diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m
index def31ea2..44de06c8 100644
--- a/Source/SPIndexesController.m
+++ b/Source/SPIndexesController.m
@@ -28,7 +28,7 @@
#import "SPServerSupport.h"
#import "SPTableContent.h"
#import "SPTableData.h"
-#import "SPMySQL.h"
+#import <SPMySQL/SPMySQL.h>
#import "SPDatabaseDocument.h"
#import "SPTablesList.h"
#import "SPTableView.h"
@@ -176,22 +176,7 @@ static const NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize";
// Check to see whether a primary key already exists for the table, and if so select INDEX instead
for (NSDictionary *field in fields)
{
- BOOL hasCompositePrimaryKey = NO;
- BOOL isPrimaryKey = [[field objectForKey:@"isprimarykey"] boolValue];
-
- // The 'isprimarykey' key of a field is only present for single column primary keys, not composite keys,
- // so we need to check the indexes manually.
- if (!isPrimaryKey) {
- for (NSDictionary *index in indexes)
- {
- if ([[index objectForKey:@"Key_name"] isEqualToString:@"PRIMARY"]) {
- hasCompositePrimaryKey = YES;
- break;
- }
- }
- }
-
- if (isPrimaryKey || hasCompositePrimaryKey) {
+ if ([[field objectForKey:@"isprimarykey"] boolValue]) {
// Hide primary key option
[[[indexTypePopUpButton menu] itemWithTag:SPPrimaryKeyMenuTag] setHidden:YES];