FluxCP
FluxCP copied to clipboard
Change default value for reg_date in table cp_createlog
File: data/schemas/logindb/cp_createlog.20080928225124.sql
Error:
Testi with MySQL 5.7 and PHP 7.1
Exception Flux_Error: Critical MySQL error in Installer/Updater: Invalid default value for 'reg_date'
Reason:
For currently reg_date defined by:
`reg_date` datetime NOT NULL default '0000-00-00 00:00:00',
But as I remember from MySQL 5.6 default '0000-00-00 00:00:00' not support anymore.
Solution:
Remove default value field reg_date. Default with 0000-00-00 00:00:00' don't make any benefit for this table.
This update is necessary for newer MySQL versions. However, it would be better to apply an additional change:
ALTER TABLE `cp_createlog`
MODIFY COLUMN `reg_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP;
This allows the reg_date field to automatically store the account creation date without causing compatibility issues.