webERP Forum
Upgrading 4.12.3 to 4.14.1 UpgradeDatabase.php error messages - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (/forumdisplay.php?fid=1)
+--- Forum: Problems / Bugs? (/forumdisplay.php?fid=8)
+--- Thread: Upgrading 4.12.3 to 4.14.1 UpgradeDatabase.php error messages (/showthread.php?tid=7972)



Upgrading 4.12.3 to 4.14.1 UpgradeDatabase.php error messages - R2-G - 12-11-2017 05:58 PM

Hi,

I am upgrading a system from 4.12.3 to 4.14.1 and the following errors appear when UpgradeDatabase.php runs.

How can I solve this ?

Thanks in advance

========================

The webERP code is version 4.14.1 and the database version is 4.12.3

Applying ./sql/mysql/upgrade4.12.3-4.13.sql

ALTER table grns ADD supplierref varchar(30) NOT NULL DEFAULT '' Failure - Error number - 1067 Invalid default value for 'deliverydate'
ALTER table stockrequest DROP FOREIGN KEY `stockrequest_ibfk_3` Failure Error number 1067 Invalid default value for 'despatchdate'
ALTER table stockrequest DROP FOREIGN KEY `stockrequest_ibfk_4` Failure Error number 1067 Invalid default value for 'despatchdate'
ALTER table bom ADD remark varchar(500) NOT NULL DEFAULT '' Failure Error number 1067 Invalid default value for 'effectiveafter'
ALTER table bom ADD digitals int(11) NOT NULL DEFAULT 0 Failure - Error number - 1067 Invalid default value for 'effectiveafter'

Applying ./sql/mysql/upgrade4.13-4.13.1.sql

ALTER TABLE `debtortrans` CHANGE `trandate` `trandate` DATE NOT NULL DEFAULT '0000-00-00' Failure - Error number - 1067 Invalid default value for 'trandate'
ALTER TABLE `stockrequest` ADD `initiator` VARCHAR(20) NOT NULL DEFAULT '' Failure - Error number - 1067 Invalid default value for 'despatchdate'
ALTER TABLE `workorders` ADD `reference` VARCHAR(40) NOT NULL DEFAULT '' Failure Error number 1067 Invalid default value for 'requiredby'
ALTER TABLE `workorders` ADD `remark` TEXT DEFAULT NULL Failure Error number 1067 Invalid default value for 'requiredby'

Applying ./sql/mysql/upgrade4.13.1-4.14.sql

UPDATE prices SET enddate='9999-12-31' WHERE enddate='0000-00-00' Failure - Error number - 1292 Incorrect date value: '0000-00-00' for column 'enddate' at row 1


RE: Upgrading 4.12.3 to 4.14.1 UpgradeDatabase.php error messages - falkoner - 12-11-2017 09:15 PM

This is an issue I have been banging on about for most of the last 10 years. Mysql can run in many different modes (https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html). Different distributions of Mysql default to different modes. One of these modes prevents zero dates (https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sqlmode_no_zero_date)

In this instance you are using a distribution with this mode set. You need to read up on setting the sql mode here (https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html#sql-mode-setting).

What I have been calling for is that we define a certain mode that is required for the system o that users don't keep getting this problem.

Tim