From eb8de9539c00c0eb9e00c1159671339b492bd90b Mon Sep 17 00:00:00 2001 From: Jason Coward Date: Fri, 16 Feb 2024 16:49:05 -0700 Subject: [PATCH] Fix default value for modManagerLog.occurred column --- core/model/modx/mysql/modmanagerlog.map.inc.php | 6 +++--- core/model/schema/modx.mysql.schema.xml | 2 +- setup/includes/upgrades/mysql/2.8.7-pl.php | 13 +++++++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 setup/includes/upgrades/mysql/2.8.7-pl.php diff --git a/core/model/modx/mysql/modmanagerlog.map.inc.php b/core/model/modx/mysql/modmanagerlog.map.inc.php index 11dfef32d2d..746f3c760bf 100644 --- a/core/model/modx/mysql/modmanagerlog.map.inc.php +++ b/core/model/modx/mysql/modmanagerlog.map.inc.php @@ -15,7 +15,7 @@ 'fields' => array ( 'user' => 0, - 'occurred' => NULL, + 'occurred' => 'CURRENT_TIMESTAMP', 'action' => '', 'classKey' => '', 'item' => '0', @@ -35,8 +35,8 @@ array ( 'dbtype' => 'datetime', 'phptype' => 'datetime', - 'null' => true, - 'default' => NULL, + 'null' => false, + 'default' => 'CURRENT_TIMESTAMP', ), 'action' => array ( diff --git a/core/model/schema/modx.mysql.schema.xml b/core/model/schema/modx.mysql.schema.xml index 6f09fd82d73..982b36e6f57 100644 --- a/core/model/schema/modx.mysql.schema.xml +++ b/core/model/schema/modx.mysql.schema.xml @@ -679,7 +679,7 @@ - + diff --git a/setup/includes/upgrades/mysql/2.8.7-pl.php b/setup/includes/upgrades/mysql/2.8.7-pl.php new file mode 100644 index 00000000000..7db939daac3 --- /dev/null +++ b/setup/includes/upgrades/mysql/2.8.7-pl.php @@ -0,0 +1,13 @@ +getTableName($class); + +$description = $this->install->lexicon('alter_column', array('column' => 'occurred', 'table' => $table)); +$this->processResults($class, $description, array($modx->manager, 'alterField'), array($class, 'occurred'));