From 12c773ff7f06a240e66a264b23261f0436e56175 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Tue, 4 Jan 2011 02:31:18 +0000 Subject: - Rework the Add Index indexes menu and the auto_increment index required menu to use tag-based values when generating queries, allowing localisation of menu contents without using those localised values in queries. This addresses I$ - Remove the ability to specify a FULLTEXT auto_increment index, as I believe this isn't possible. - Prevent sheet reuse from specifying invalid storage types for PRIMARY KEYs - Fix exceptions when adding indexes to a table where every field is already indexed - Fix initialField/indexedFieldNames check to improve on r3061 - Fix toggling advanced index view after closing the sheet with the view open - Update localisable strings --- Source/SPTableStructure.m | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Source/SPTableStructure.m') diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m index f57a881f..8e6b7e77 100644 --- a/Source/SPTableStructure.m +++ b/Source/SPTableStructure.m @@ -1219,8 +1219,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]) -- cgit v1.2.3