aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPIndexesController.m
diff options
context:
space:
mode:
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];