aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableStructure.m
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2014-03-19 19:51:00 +0100
committerMax <post@wickenrode.com>2014-03-19 19:51:00 +0100
commitf9837de31479152d8c29f06222bac3f5541b60b3 (patch)
treee84021b72921740b3b7799e7d0f7d9e8bb1ebc00 /Source/SPTableStructure.m
parent2645c9480332d8dde088e09a57504cdd26a541b1 (diff)
downloadsequelpro-f9837de31479152d8c29f06222bac3f5541b60b3.tar.gz
sequelpro-f9837de31479152d8c29f06222bac3f5541b60b3.tar.bz2
sequelpro-f9837de31479152d8c29f06222bac3f5541b60b3.zip
Add basic support for CURRENT_TIMESTAMP in DATETIME columns (MySQL 5.6.5)
See #1867
Diffstat (limited to 'Source/SPTableStructure.m')
-rw-r--r--Source/SPTableStructure.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m
index b2675271..807ff1ae 100644
--- a/Source/SPTableStructure.m
+++ b/Source/SPTableStructure.m
@@ -856,8 +856,8 @@ static NSString *SPRemoveFieldAndForeignKey = @"SPRemoveFieldAndForeignKey";
[queryString appendString:@"\n DEFAULT NULL"];
}
}
- // Otherwise, if CURRENT_TIMESTAMP was specified for timestamps, use that
- else if ([theRowType isEqualToString:@"TIMESTAMP"] &&
+ // Otherwise, if CURRENT_TIMESTAMP was specified for timestamps/datetimes, use that
+ else if (([theRowType isEqualToString:@"TIMESTAMP"] || [theRowType isEqualToString:@"DATETIME"]) &&
[[[theRow objectForKey:@"default"] uppercaseString] isEqualToString:@"CURRENT_TIMESTAMP"])
{
[queryString appendString:@"\n DEFAULT CURRENT_TIMESTAMP"];