diff options
author | rowanbeentje <rowan@beent.je> | 2010-12-05 00:40:09 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2010-12-05 00:40:09 +0000 |
commit | 5d61e164670c386e73de8903dace40802f00fc00 (patch) | |
tree | aeac970c32bc95ca0db8a6a8671a26d2cdb38bd7 /Source/SPDotExporter.m | |
parent | c84d39d22cdc466b6a3d0c0e71966d074789b090 (diff) | |
download | sequelpro-5d61e164670c386e73de8903dace40802f00fc00.tar.gz sequelpro-5d61e164670c386e73de8903dace40802f00fc00.tar.bz2 sequelpro-5d61e164670c386e73de8903dace40802f00fc00.zip |
Apply a tweaked version of a patch by Aaron Linville (http://www.linville.org/) to handle table linking in .dot exports on case-insensitive servers:
- Adds a new checkbox on the .dot export interface controlling the case sensitivty of link handling
- Improve .dot export to use lowercase link references when the option is enabled, fixing .dot exports of table relations of table names with uppercase characters on case-insensitive servers
- Check the server's case-sensitivity setting and use that to control the checkbox when using the export interface to select .dot export
This addresses Issue #920.
Diffstat (limited to 'Source/SPDotExporter.m')
-rw-r--r-- | Source/SPDotExporter.m | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/SPDotExporter.m b/Source/SPDotExporter.m index 85b497e9..55ab645b 100644 --- a/Source/SPDotExporter.m +++ b/Source/SPDotExporter.m @@ -33,6 +33,7 @@ @synthesize delegate; @synthesize dotExportTables; @synthesize dotExportCurrentTable; +@synthesize dotForceLowerTableNames; @synthesize dotTableData; @synthesize dotDatabaseHost; @synthesize dotDatabaseName; @@ -115,6 +116,7 @@ } NSString *tableName = NSArrayObjectAtIndex([self dotExportTables], i); + NSString *tableLinkName = [self dotForceLowerTableNames]?[tableName lowercaseString]:tableName; NSDictionary *tableInfo = [[self dotTableData] informationForTable:tableName]; // Set the current table @@ -131,7 +133,7 @@ [metaString setString:[NSString stringWithFormat:@"\tsubgraph \"table_%@\" {\n", tableName]]; [metaString appendString:@"\t\tnode [ shape = \"plaintext\" ];\n"]; - [metaString appendFormat:@"\t\t\"%@\" [ label=<\n", tableName]; + [metaString appendFormat:@"\t\t\"%@\" [ label=<\n", tableLinkName]; [metaString appendString:@"\t\t\t<TABLE BORDER=\"0\" CELLSPACING=\"0\" CELLBORDER=\"1\">\n"]; [metaString appendFormat:@"\t\t\t<TR><TD COLSPAN=\"3\" BGCOLOR=\"%@\">%@</TD></TR>\n", hdrColor, tableName]; @@ -173,7 +175,7 @@ extra = @" [ arrowhead=crow, arrowtail=odiamond ]"; } - [fkInfo addObject:[NSString stringWithFormat:@"%@:%@ -> %@:%@ %@", tableName, [originColumns objectAtIndex:0], [aConstraint objectForKey:@"ref_table"], [referenceColumns objectAtIndex:0], extra]]; + [fkInfo addObject:[NSString stringWithFormat:@"%@:%@ -> %@:%@ %@", tableLinkName, [originColumns objectAtIndex:0], [aConstraint objectForKey:@"ref_table"], [[referenceColumns objectAtIndex:0] lowercaseString], extra]]; } } |