aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableStructure.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-10-25 12:45:18 +0000
committerBibiko <bibiko@eva.mpg.de>2010-10-25 12:45:18 +0000
commitbe97d12d4f5df97b268bd017f124d932f8d5d4a9 (patch)
tree36a6cd1273d862f31e758d1c5973f23fade660a8 /Source/SPTableStructure.m
parent0915f9d8dcdf2177ce700dca036a629d00178dcd (diff)
downloadsequelpro-be97d12d4f5df97b268bd017f124d932f8d5d4a9.tar.gz
sequelpro-be97d12d4f5df97b268bd017f124d932f8d5d4a9.tar.bz2
sequelpro-be97d12d4f5df97b268bd017f124d932f8d5d4a9.zip
• improved the TableStructure handling of GEOMETRY fields and their validations against non-valid WKT notations - return NULL if no header
Diffstat (limited to 'Source/SPTableStructure.m')
-rw-r--r--Source/SPTableStructure.m6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m
index e6afab2d..5c5a400a 100644
--- a/Source/SPTableStructure.m
+++ b/Source/SPTableStructure.m
@@ -1546,7 +1546,7 @@ returns a dictionary containing enum/set field names as key and possible values
if(anObject && [(NSString*)anObject length] && ![(NSString*)anObject hasPrefix:@"--"]) {
[currentRow setObject:[(NSString*)anObject uppercaseString] forKey:@"type"];
// If type is BLOB or TEXT reset DEFAULT since these field types don't allow a default
- if([[currentRow objectForKey:@"type"] hasSuffix:@"TEXT"] || [[currentRow objectForKey:@"type"] hasSuffix:@"BLOB"]) {
+ if([[currentRow objectForKey:@"type"] hasSuffix:@"TEXT"] || [[currentRow objectForKey:@"type"] hasSuffix:@"BLOB"] || [self _isFieldTypeGeometry:[currentRow objectForKey:@"type"]]) {
[currentRow setObject:@"" forKey:@"default"];
[currentRow setObject:@"" forKey:@"length"];
}
@@ -1897,9 +1897,9 @@ would result in a position change.
else if([[aTableColumn identifier] isEqualToString:@"binary"]) {
[aCell setEnabled:([self _isFieldTypeAllowBinary:theRowType])];
}
- // TEXT or BLOB fields don't allow a DEFAULT
+ // TEXT, BLOB, and GEOMETRY fields don't allow a DEFAULT
else if([[aTableColumn identifier] isEqualToString:@"default"]) {
- [aCell setEnabled:([theRowType hasSuffix:@"TEXT"] || [theRowType hasSuffix:@"BLOB"]) ? NO : YES];
+ [aCell setEnabled:([theRowType hasSuffix:@"TEXT"] || [theRowType hasSuffix:@"BLOB"] || [self _isFieldTypeGeometry:theRowType]) ? NO : YES];
}
// Check allow NULL
else if([[aTableColumn identifier] isEqualToString:@"null"]) {