Bug #87288 Sync Model to Live - DATETIME ON UPDATE CURRENT_TIMESTAMP
Submitted: 2 Aug 2017 20:08 Modified: 3 Aug 2017 7:00
Reporter: Will Baumbach Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:6.3.9 OS:Windows (Microsoft Windows 10 Pro)
Assigned to: CPU Architecture:Any
Tags: datetime, WBBugReporter

[2 Aug 2017 20:08] Will Baumbach
Description:
In short, MySQL Workbench flags every table with `ON UPDATE CURRENT_TIMESTAMP` as needing to change to remove the expression.

How to repeat:
CREATE TABLE `test_table` (
	`id` INT(10) NOT NULL AUTO_INCREMENT,
	`expired` DATETIME NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
	PRIMARY KEY (`id`),
	INDEX `expired` (`expired`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;

In MySQL Workbench
1) Connect to Data Source
2) Click Database
3) Click Reverse Engineer
4) Select Database containing `test_table` -> Next -> Next
5) Select Schema containing `test_table` -> Next 
6) Uncheck place imported objects on a diagram (and others if the exist)
7) Check Import MySQL Table Objects -> Execute -> Next -> Finish
8) Verify `test_table`.`expired` has default/expression of `ON UPDATE CURRENT_TIMESTAMP`
9) Click Database
10) Click Synchronize with Any Source
11) Select Model Schemata
12) Select Live Database Server
13) Select ALTER Script File: (choose a path) -> Next
14) Repeat Steps 4 through 5 above 
15) View Alter data of `test_table` of:

ALTER TABLE `test`.`test_table` 
CHANGE COLUMN `expired` `expired` DATETIME NULL DEFAULT NULL

Suggested fix:
Include the default/expression as defined in the model/database.
[2 Aug 2017 20:10] Will Baumbach
illustrated recreation of issue

Attachment: model_error.PNG (image/png, text), 99.61 KiB.

[2 Aug 2017 23:29] Will Baumbach
Changed to non-critical, as it does not affect performance or loss of service, but hinders operation of the feature, making it inconvenient.
[3 Aug 2017 7:00] MySQL Verification Team
Hello Will Baumbach,

Thank you for the report and steps.
Verified as described with WB 6.3.9 on Win7.

Thanks,
Umesh