Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default value for modManagerLog.occurred column #16526

Merged
merged 3 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/model/schema/modx.mysql.schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@

<object class="modManagerLog" table="manager_log" extends="xPDO\Om\xPDOSimpleObject">
<field key="user" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
<field key="occurred" dbtype="datetime" phptype="datetime" null="true" default="NULL" />
<field key="occurred" dbtype="datetime" phptype="datetime" null="false" default="CURRENT_TIMESTAMP" />
<field key="action" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
<field key="classKey" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
<field key="item" dbtype="varchar" precision="255" phptype="string" null="false" default="0" />
Expand Down
6 changes: 3 additions & 3 deletions core/src/Revolution/mysql/modManagerLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class modManagerLog extends \MODX\Revolution\modManagerLog
'fields' =>
array (
'user' => 0,
'occurred' => NULL,
'occurred' => 'CURRENT_TIMESTAMP',
'action' => '',
'classKey' => '',
'item' => '0',
Expand All @@ -38,8 +38,8 @@ class modManagerLog extends \MODX\Revolution\modManagerLog
array (
'dbtype' => 'datetime',
'phptype' => 'datetime',
'null' => true,
'default' => NULL,
'null' => false,
'default' => 'CURRENT_TIMESTAMP',
),
'action' =>
array (
Expand Down
12 changes: 12 additions & 0 deletions setup/includes/upgrades/common/3.0.5-db-changes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

/**
* Database changes for 3.0.5
*
* @var modX $modx
* @package setup
*/

$manager = $modx->getManager();

$manager->alterField(\MODX\Revolution\modManagerLog::class, 'occurred');
11 changes: 11 additions & 0 deletions setup/includes/upgrades/mysql/3.0.5-pl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
/**
* Specific upgrades for Revolution 3.0.5-pl
*
* @var modX $modx
* @package setup
* @subpackage upgrades
*/

/* run upgrades common to all db platforms */
include dirname(__DIR__) . '/common/3.0.5-db-changes.php';
Loading