aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-10-12 10:10:49 +0000
committerstuconnolly <stuart02@gmail.com>2010-10-12 10:10:49 +0000
commit1ce6245b609179935da05c90735a1607c1949d2e (patch)
tree0dfab8e124e7bd98e87915e26b688d050955a6f1
parent356294998ce0cb95447b2e0dc86680cd06be8bca (diff)
downloadsequelpro-1ce6245b609179935da05c90735a1607c1949d2e.tar.gz
sequelpro-1ce6245b609179935da05c90735a1607c1949d2e.tar.bz2
sequelpro-1ce6245b609179935da05c90735a1607c1949d2e.zip
Fix a bug when adding a PRIMARY KEY index, introduced in r2742. Fixes issue #863.
-rw-r--r--Source/SPIndexesController.m4
1 files 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];