From 1ce6245b609179935da05c90735a1607c1949d2e Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Tue, 12 Oct 2010 10:10:49 +0000 Subject: Fix a bug when adding a PRIMARY KEY index, introduced in r2742. Fixes issue #863. --- Source/SPIndexesController.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/SPIndexesController.m b/Source/SPIndexesController.m index c0bf2448..2bfa527b 100644 --- a/Source/SPIndexesController.m +++ b/Source/SPIndexesController.m @@ -678,8 +678,8 @@ NSString *SPNewIndexKeyBlockSize = @"IndexKeyBlockSize"; [tempIndexedColumns addObject:[columnName backtickQuotedString]]; } } - - if (![indexType isEqualToString:@"INDEX"]) indexType = [indexType stringByAppendingFormat:@" INDEX"]; + + if ((![indexType isEqualToString:@"INDEX"]) && (![indexType isEqualToString:@"PRIMARY KEY"])) indexType = [indexType stringByAppendingFormat:@" INDEX"]; // Build the query NSMutableString *query = [NSMutableString stringWithFormat:@"ALTER TABLE %@ ADD %@", [table backtickQuotedString], indexType]; -- cgit v1.2.3