diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-03-06 12:36:37 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-03-06 12:36:37 +0000 |
commit | 5052718afb789f21654e094f2d065baf6bb6ac81 (patch) | |
tree | 88e9f2f8c03a7bf995208f17f619e3d40a437d71 /Source/SPFieldMapperController.m | |
parent | 37b41c535f442aa85750679dccc7885655cb3429 (diff) | |
download | sequelpro-5052718afb789f21654e094f2d065baf6bb6ac81.tar.gz sequelpro-5052718afb789f21654e094f2d065baf6bb6ac81.tar.bz2 sequelpro-5052718afb789f21654e094f2d065baf6bb6ac81.zip |
• CSV Import Field Mapper
- fixed some issues for displaying the default values for auto_increment and time_stamp
• added possibility to change the tab stop width in each CMTextView via Preference setting in Editor window
Diffstat (limited to 'Source/SPFieldMapperController.m')
-rw-r--r-- | Source/SPFieldMapperController.m | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index 5ed301d3..7224c38a 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -284,7 +284,7 @@ [selectedTableData setConnection:mySQLConnection]; NSDictionary *tableDetails = [selectedTableData informationForTable:[tableTargetPopup titleOfSelectedItem]]; BOOL isReplacePossible = NO; - + // NSLog(@"d %@", tableDetails); if (tableDetails) { for (NSDictionary *column in [tableDetails objectForKey:@"columns"]) { [fieldMappingTableColumnNames addObject:[NSString stringWithString:[column objectForKey:@"name"]]]; @@ -298,17 +298,24 @@ if([column objectForKey:@"isprimarykey"]) { [type appendFormat:@",%@",@"PRIMARY"]; - [fieldMappingTableDefaultValues addObject:@"auto_increment"]; + if([[[column objectForKey:@"autoincrement"] description] isEqualToString:@"1"]) { + [fieldMappingTableDefaultValues addObject:@"auto_increment"]; + } else { + [fieldMappingTableDefaultValues addObject:@"0"]; + } isReplacePossible = YES; } else { if([column objectForKey:@"unique"]) { [type appendFormat:@",%@",@"UNIQUE"]; isReplacePossible = YES; } - if ([column objectForKey:@"default"]) - [fieldMappingTableDefaultValues addObject:[column objectForKey:@"default"]]; + if([[[column objectForKey:@"onupdatetimestamp"] description] isEqualToString:@"1"]) + [fieldMappingTableDefaultValues addObject:@"time_stamp"]; else - [fieldMappingTableDefaultValues addObject:@"NULL"]; + if ([column objectForKey:@"default"]) + [fieldMappingTableDefaultValues addObject:[column objectForKey:@"default"]]; + else + [fieldMappingTableDefaultValues addObject:@"NULL"]; } [fieldMappingTableTypes addObject:[NSString stringWithString:type]]; |