diff options
author | rowanbeentje <rowan@beent.je> | 2009-07-07 00:20:52 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-07-07 00:20:52 +0000 |
commit | 81bb447b85556d3544fc3195cd2d40bae7200d39 (patch) | |
tree | 6ef267092256324e2b4d21bfdfa6f4ac21ae0552 /Source/TableDump.m | |
parent | 47bedef42fc896ad8f3dd9736993b4975890b440 (diff) | |
download | sequelpro-81bb447b85556d3544fc3195cd2d40bae7200d39.tar.gz sequelpro-81bb447b85556d3544fc3195cd2d40bae7200d39.tar.bz2 sequelpro-81bb447b85556d3544fc3195cd2d40bae7200d39.zip |
- Fix placeholder exports of views containing enums, improving on r959
Diffstat (limited to 'Source/TableDump.m')
-rw-r--r-- | Source/TableDump.m | 8 |
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"]]; } |