diff options
author | Max <post@wickenrode.com> | 2015-01-06 23:14:21 +0100 |
---|---|---|
committer | Max <post@wickenrode.com> | 2015-01-06 23:15:49 +0100 |
commit | 56949ac737a3838f3276d0e558fd0dac7632aae5 (patch) | |
tree | 1c24380ce3b6bbc1ddb0a21f7bc9acb948258c6c /Source/SPDatabaseDocument.m | |
parent | 4ffde6a4867ae005405f586947cf943097c212c1 (diff) | |
download | sequelpro-56949ac737a3838f3276d0e558fd0dac7632aae5.tar.gz sequelpro-56949ac737a3838f3276d0e558fd0dac7632aae5.tar.bz2 sequelpro-56949ac737a3838f3276d0e558fd0dac7632aae5.zip |
Change some code formatting
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r-- | Source/SPDatabaseDocument.m | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index a0a6bf1c..269e62d4 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -5312,9 +5312,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; } NSInteger itemType = SPTableTypeNone; - NSString *itemTypeStr = @"TABLE"; NSUInteger i; - NSInteger queryCol = 1; // Loop through the unfiltered tables/views to find the desired item for (i = 0; i < [availableItems count]; i++) { @@ -5327,19 +5325,26 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // If no match found, continue if (itemType == SPTableTypeNone) continue; + NSString *itemTypeStr; + NSInteger queryCol; + switch(itemType) { case SPTableTypeTable: case SPTableTypeView: - itemTypeStr = @"TABLE"; - break; + itemTypeStr = @"TABLE"; + queryCol = 1; + break; case SPTableTypeProc: - itemTypeStr = @"PROCEDURE"; - queryCol = 2; - break; + itemTypeStr = @"PROCEDURE"; + queryCol = 2; + break; case SPTableTypeFunc: - itemTypeStr = @"FUNCTION"; - queryCol = 2; - break; + itemTypeStr = @"FUNCTION"; + queryCol = 2; + break; + default: + NSLog(@"%s: Unhandled SPTableType=%ld for item=%@ (skipping)", __func__, itemType, item); + continue; } // Ensure that queries are made in UTF8 |