FluxCP icon indicating copy to clipboard operation
FluxCP copied to clipboard

Change default value for reg_date in table cp_createlog

Open vietlubu opened this issue 7 years ago • 1 comments

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.

vietlubu avatar Oct 13 '18 02:10 vietlubu

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.

danieldpl avatar Jun 24 '25 03:06 danieldpl