Bug #78684 Table structure editor doesn't allow TIMESTAMP type
Submitted: 2 Oct 2015 16:45 Modified: 9 Oct 2015 0:50
Reporter: Jeff Kopmanis Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Workbench Severity:S1 (Critical)
Version:6.3.4 OS:MacOS (OS X 10.10.x Yosemite)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[2 Oct 2015 16:45] Jeff Kopmanis
Description:
----[For better reports, please attach the log file after submitting. You can find it in /Users/kopmanis/Library/Application Support/MySQL/Workbench/log/wb.log]

I tried creating a field with the type TIMESTAMP(), with a default value of:

  CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

but each time, it would change the type back to DATETIME.  Probably accurate, but when you tried to Forward Engineer the EER diagram, it fails on that field.

How to repeat:
I tried creating a field with the type TIMESTAMP(), with a default value of:

  CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

but each time, it would change the type back to DATETIME.  Probably accurate, but when you tried to Forward Engineer the EER diagram, it fails on that field.

Suggested fix:
quit overriding the type!
[2 Oct 2015 16:46] Jeff Kopmanis
it was the recommended file

Attachment: wb.log (application/octet-stream, text), 4.56 KiB.

[6 Oct 2015 13:48] MySQL Verification Team
Thank you for the bug report. Are you able to provide a model file which fails to forward?. Thanks.
[6 Oct 2015 13:52] Jeff Kopmanis
I've added a model to the bug report.  the table app_status is where I had to manually override things in the SQL editor in the wizard to get a timestamp with an auto-update defined.
[9 Oct 2015 0:50] MySQL Verification Team
Thank you for the feedback. Please read:

https://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.html

Then if you remove the () from TIMESTAMP() you can use the DEFAULT:

CREATE TABLE t1 (
  ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

or when you type 6 so TIMESTAMP(6) you can use the DEFAULT:

CREATE TABLE t1 (
  ts TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
);

Hope this help you.