-
-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix default value for modManagerLog.occurred column (#16527)
### What does it do? Adds a default value for the datetime column in the modx_manager_log table that is compatible with strict modes, which may be enabled in some environments. Re-up of #15736 with migration ### Why is it needed? Beginning with MySQL > 5.7.8 added strict modes ERROR_FOR_DIVISION_BY_ZERO, NO_ZERO_DATE, NO_ZERO_IN_DATE. With these strict modes enabled, a datetime default value cannot be NULL and must be > '0000-00-00'. ### How to test Install/update on MySQL 5.7.8 ### Related issue(s)/PR(s) Re-up of #15736 Backport of #16526
- Loading branch information
Showing
3 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
/** | ||
* MySQL upgrade script for 2.8.7 | ||
* | ||
* @var modX $modx | ||
* @package setup | ||
*/ | ||
|
||
$class = 'modManagerLog'; | ||
$table = $modx->getTableName($class); | ||
|
||
$description = $this->install->lexicon('alter_column', array('column' => 'occurred', 'table' => $table)); | ||
$this->processResults($class, $description, array($modx->manager, 'alterField'), array($class, 'occurred')); |