aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableStructure.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2011-01-27 20:38:23 +0000
committerstuconnolly <stuart02@gmail.com>2011-01-27 20:38:23 +0000
commit8db2f78294982e89fce5a162d92b2be6d9291aa1 (patch)
treeb8dc7736f4af896aa3ed3fa9a96d1f3c4bfd0e59 /Source/SPTableStructure.m
parentfa7cff57548edc51420693e6909fe2adb3c18951 (diff)
parent7cc062247ff23496dd0390cf07b5d45d6bc49777 (diff)
downloadsequelpro-8db2f78294982e89fce5a162d92b2be6d9291aa1.tar.gz
sequelpro-8db2f78294982e89fce5a162d92b2be6d9291aa1.tar.bz2
sequelpro-8db2f78294982e89fce5a162d92b2be6d9291aa1.zip
Bring outline view branch up to date with trunk (r3056:r3162).
Diffstat (limited to 'Source/SPTableStructure.m')
-rw-r--r--Source/SPTableStructure.m22
1 files changed, 13 insertions, 9 deletions
diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m
index f57a881f..1cd5ca4e 100644
--- a/Source/SPTableStructure.m
+++ b/Source/SPTableStructure.m
@@ -758,13 +758,7 @@
*/
- (void)setAutoIncrementTo:(NSString*)valueAsString
{
- NSString *selTable = nil;
-
- // if selectedTable is nil try to get the name from SPTablesList
- if (selectedTable == nil || ![selectedTable length])
- selTable = [tablesListInstance tableName];
- else
- selTable = [NSString stringWithString:selectedTable];
+ NSString *selTable = [tablesListInstance tableName];
if (selTable == nil || ![selTable length]) return;
@@ -1219,8 +1213,18 @@
alertSheetOpened = NO;
if(contextInfo && [contextInfo isEqualToString:@"autoincrementindex"]) {
- if(returnCode) {
- autoIncrementIndex = [chooseKeyButton titleOfSelectedItem];
+ if (returnCode) {
+ switch ([[chooseKeyButton selectedItem] tag]) {
+ case SPPrimaryKeyMenuTag:
+ autoIncrementIndex = @"PRIMARY KEY";
+ break;
+ case SPIndexMenuTag:
+ autoIncrementIndex = @"INDEX";
+ break;
+ case SPUniqueMenuTag:
+ autoIncrementIndex = @"UNIQUE";
+ break;
+ }
} else {
autoIncrementIndex = nil;
if([tableSourceView selectedRow] > -1 && [extraFieldSuggestions count])