Upgrade CDD 6.5 to 6.7 generates Error creation_date datetime DEFAULT CURRENT-TIMESTAMP NOT NULL

Document ID : KB000097221
Last Modified Date : 21/05/2018
Show Technical Document Details
Issue:
Upgrading Continuous Delivery Director (CDD) from 6.5 to 6.7 causes an ERROR " Invalid default value for 'creation_date"

Error Details:
                Migration V6.7.0.0.20171226144409__add_creation_date_to_test_source.sql failed
------------------------------------------------------------------------------
SQL State  : 42000
Error Code : 1067
Message    : Invalid default value for 'creation_date'
Location   : sql/tenant/mysql/V6.7.0.0.20171226144409__add_creation_date_to_test_source.sql (/opt/tomcat8/webapps/cdd/WEB-INF/classes/sql/tenant/mysql/V6.7.0.0.20171226144409__add_creation_date_to_test_source.sql)
Line       : 1
Statement  : ALTER TABLE test_source ADD creation_date datetime DEFAULT CURRENT_TIMESTAMP NOT NULL

 
Environment:
Continuous Delivery Director (CDD) : 6.4->6.6
Database: MySQL 5.5.
Cause:
MySQL 5.5 is released back in 2010 and doesn't support default values for the current_timestamp function which results in the error. CDD 6.7 uses this feature and hence results in failure while performing ALTER operation on the table. The feature of allowing default value to current_timestamp was added in MySQL 5.6+

 
Resolution:
Upgrade the database to 5.6 / 5.7 or higher before upgrade.
Additional Information: