aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableData.m
diff options
context:
space:
mode:
authordmoagx <post@wickenrode.com>2013-04-21 21:05:56 +0000
committerdmoagx <post@wickenrode.com>2013-04-21 21:05:56 +0000
commit974a17c6403e75eb23eef4a270ff0d70b37c91de (patch)
tree1c72d942e561659508c67210d926f0e94630a900 /Source/SPTableData.m
parent758789b3bba80f91182730841cb54ba0f3c86de4 (diff)
downloadsequelpro-974a17c6403e75eb23eef4a270ff0d70b37c91de.tar.gz
sequelpro-974a17c6403e75eb23eef4a270ff0d70b37c91de.tar.bz2
sequelpro-974a17c6403e75eb23eef4a270ff0d70b37c91de.zip
* Composite Foreign Keys will now show all columns in Relation view (workaround)
Diffstat (limited to 'Source/SPTableData.m')
-rw-r--r--Source/SPTableData.m12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/SPTableData.m b/Source/SPTableData.m
index 311108f2..594d1df4 100644
--- a/Source/SPTableData.m
+++ b/Source/SPTableData.m
@@ -645,8 +645,16 @@
[fieldsParser setString:[[parts objectAtIndex:6] stringByTrimmingCharactersInSet:bracketSet]];
[constraintDetails setObject:[fieldsParser unquotedString] forKey:@"ref_table"];
- [fieldsParser setString:[[parts objectAtIndex:7] stringByTrimmingCharactersInSet:bracketSet]];
- [constraintDetails setObject:[fieldsParser unquotedString] forKey:@"ref_columns"];
+ NSMutableArray *refKeyColumns = [NSMutableArray array];
+ NSArray *refKeyColumnStrings = [[[parts objectAtIndex:7] stringByTrimmingCharactersInSet:bracketSet] componentsSeparatedByString:@","];
+
+ for (NSString *keyColumn in refKeyColumnStrings)
+ {
+ [fieldsParser setString:[[keyColumn stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] stringByTrimmingCharactersInSet:bracketSet]];
+ [refKeyColumns addObject:[fieldsParser unquotedString]];
+ }
+
+ [constraintDetails setObject:refKeyColumns forKey:@"ref_columns"];
NSUInteger nextOffs = 12;