aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-07-07 00:20:52 +0000
committerrowanbeentje <rowan@beent.je>2009-07-07 00:20:52 +0000
commit81bb447b85556d3544fc3195cd2d40bae7200d39 (patch)
tree6ef267092256324e2b4d21bfdfa6f4ac21ae0552
parent47bedef42fc896ad8f3dd9736993b4975890b440 (diff)
downloadsequelpro-81bb447b85556d3544fc3195cd2d40bae7200d39.tar.gz
sequelpro-81bb447b85556d3544fc3195cd2d40bae7200d39.tar.bz2
sequelpro-81bb447b85556d3544fc3195cd2d40bae7200d39.zip
- Fix placeholder exports of views containing enums, improving on r959
-rw-r--r--Source/TableDump.m8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m
index cf90eb1a..a902e17b 100644
--- a/Source/TableDump.m
+++ b/Source/TableDump.m
@@ -2027,7 +2027,7 @@
NSMutableString *placeholderSyntax, *fieldString;
NSArray *viewColumns;
NSDictionary *column;
- int i;
+ int i, j;
// Get structured information for the view via the SPTableData parsers
viewInformation = [tableDataInstance informationForView:viewName];
@@ -2046,6 +2046,12 @@
// Add the type and length information as appropriate
if ([column objectForKey:@"length"]) {
[fieldString appendFormat:@" %@(%@)", [column objectForKey:@"type"], [column objectForKey:@"length"]];
+ } else if ([column objectForKey:@"values"]) {
+ [fieldString appendFormat:@" %@(", [column objectForKey:@"type"]];
+ for (j = 0; j < [[column objectForKey:@"values"] count]; j++) {
+ [fieldString appendFormat:@"'%@'%@", [mySQLConnection prepareString:[[column objectForKey:@"values"] objectAtIndex:j]], (j+1 == [[column objectForKey:@"values"] count])?@"":@","];
+ }
+ [fieldString appendString:@")"];
} else {
[fieldString appendFormat:@" %@", [column objectForKey:@"type"]];
}