diff options
Diffstat (limited to 'Source/SPIndexesController.m')
-rw-r--r-- | Source/SPIndexesController.m | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m index 99d359f7..f4f03d28 100644 --- a/Source/SPIndexesController.m +++ b/Source/SPIndexesController.m @@ -187,22 +187,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]; |