diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-02-20 17:53:02 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-02-20 17:53:02 +0000 |
commit | e08596ccfd20d826ce21256e6b41617814077e97 (patch) | |
tree | deb4b26a90e6dd139a3ef04de8b485fc428d23f1 /Source | |
parent | 50c726232203af0ae46a0641ca10bd126c78dc2c (diff) | |
download | sequelpro-e08596ccfd20d826ce21256e6b41617814077e97.tar.gz sequelpro-e08596ccfd20d826ce21256e6b41617814077e97.tar.bz2 sequelpro-e08596ccfd20d826ce21256e6b41617814077e97.zip |
• applied new SPTableData keys "PRIMARY" and "UNIQUE" information to the mapping table
- set tokenField to noWrap
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SPFieldMapperController.m | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index a44f5ca2..616497b4 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -218,10 +218,6 @@ if (tableDetails) { for (NSDictionary *column in [tableDetails objectForKey:@"columns"]) { [fieldMappingTableColumnNames addObject:[NSString stringWithString:[column objectForKey:@"name"]]]; - // if([column objectForKey:@"default"]) - // [fieldMappingTableDefaultValues addObject:[NSString stringWithString:[column objectForKey:@"default"]]]; - // else - // [fieldMappingTableDefaultValues addObject:@""]; NSMutableString *type = [NSMutableString string]; if([column objectForKey:@"type"]) [type appendString:[column objectForKey:@"type"]]; @@ -229,10 +225,16 @@ [type appendFormat:@"(%@)", [column objectForKey:@"length"]]; if([column objectForKey:@"values"]) [type appendFormat:@"(%@)", [[column objectForKey:@"values"] componentsJoinedByString:@"¦"]]; - if([column objectForKey:@"autoincrement"] && [[column objectForKey:@"autoincrement"] integerValue] == 1) - [type appendFormat:@",%@",@"PRIMARY KEY"]; - else if ([column objectForKey:@"default"]) - [type appendFormat:@",%@",[column objectForKey:@"default"]]; + + if([column objectForKey:@"isprimarykey"]) { + [type appendFormat:@",%@",@"PRIMARY"]; + } else { + if([column objectForKey:@"unique"]) + [type appendFormat:@",%@",@"UNIQUE"]; + if ([column objectForKey:@"default"]) + [type appendFormat:@",%@",[column objectForKey:@"default"]]; + } + [fieldMappingTableTypes addObject:[NSString stringWithString:type]]; } } @@ -612,8 +614,7 @@ if ([fieldMappingOperatorArray objectAtIndex:rowIndex] == doNotImport) return @""; if([NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue]>=[NSArrayObjectAtIndex(fieldMappingImportArray, 0) count]) - return [NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"Global value", @"global value"), - NSArrayObjectAtIndex(fieldMappingGlobalValues, [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue])]; + return [NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"Global value", @"global value"), NSArrayObjectAtIndex(fieldMappingGlobalValues, [NSArrayObjectAtIndex(fieldMappingArray, rowIndex) integerValue])]; if(fieldMappingCurrentRow) return [NSString stringWithFormat:@"%@: %@", @@ -664,6 +665,7 @@ NSTokenFieldCell *b = [[[NSTokenFieldCell alloc] initTextCell:[fieldMappingTableTypes objectAtIndex:rowIndex]] autorelease]; [b setEditable:NO]; [b setAlignment:NSLeftTextAlignment]; + [b setWraps:NO]; [b setFont:[NSFont systemFontOfSize:9]]; [b setDelegate:self]; return b; |