aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableStructure.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-12-08 00:56:08 +0000
committerrowanbeentje <rowan@beent.je>2010-12-08 00:56:08 +0000
commit70dc76057c5e61497a5ef495df2a90c91335b44b (patch)
tree1a92bb6f0e9857e6c8e313e68b672f320290f45d /Source/SPTableStructure.m
parentb05d20103968508fa41dc1fc1e1d8a111c93f84a (diff)
downloadsequelpro-70dc76057c5e61497a5ef495df2a90c91335b44b.tar.gz
sequelpro-70dc76057c5e61497a5ef495df2a90c91335b44b.tar.bz2
sequelpro-70dc76057c5e61497a5ef495df2a90c91335b44b.zip
- Don't specify DEFAULT '' when saving TEXT, BLOB or geometry field types; this avoids errors in strict mode
Diffstat (limited to 'Source/SPTableStructure.m')
-rw-r--r--Source/SPTableStructure.m5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m
index 79a0a0a2..f57a881f 100644
--- a/Source/SPTableStructure.m
+++ b/Source/SPTableStructure.m
@@ -1015,8 +1015,9 @@
else if ([[theRow objectForKey:@"default"] length] && [theRowType isEqualToString:@"BIT"]) {
[queryString appendFormat:@"\n DEFAULT %@", [theRow objectForKey:@"default"]];
}
- // Suppress appending DEFAULT clause for any numerics, date, time fields if default is empty to avoid error messages
- else if (![[theRow objectForKey:@"default"] length] && ([fieldValidation isFieldTypeNumeric:theRowType] || [fieldValidation isFieldTypeDate:theRowType])) {
+ // Suppress appending DEFAULT clause for any numerics, date, time fields if default is empty to avoid error messages;
+ // also don't specify a default for TEXT/BLOB or geometry fields to avoid strict mode errors
+ else if (![[theRow objectForKey:@"default"] length] && ([fieldValidation isFieldTypeNumeric:theRowType] || [fieldValidation isFieldTypeDate:theRowType] || [theRowType hasSuffix:@"TEXT"] || [theRowType hasSuffix:@"BLOB"] || [fieldValidation isFieldTypeGeometry:theRowType])) {
;
}
// Otherwise, use the provided default