-
-
Notifications
You must be signed in to change notification settings - Fork 526
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 modManagerLog MySQL > 5.7.8 #15736
Conversation
There could be an update script to modify that table column for existing installations too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs an update script to correct existing installations before being accepted.
@catsmeatman would it be possible for you to create an upgrade script? |
@JoshuaLuckers where can I read how to do this? |
This can be done like this: https://github.com/modxcms/revolution/blob/2.x/setup/includes/upgrades/mysql/2.0.4-pl.php You have to create a file 2.8.4-pl.php with some ALTER TABLE code. |
@Jako Thx, I'll do it this weekend |
@catsmeatman Please make the suggested edits @Jako |
Add right default value for datatime-type column in modx_manager_log table Re-up of modxcms#15736 with migration
As this PR has gone stale I've re-created it for 3.x in #16520. |
Add right default value for datatime-type column in modx_manager_log table Re-up of modxcms#15736 with migration Satisfy phpcs
@Mark-H will you back port this for 2.8.7? |
Add right default value for datatime-type column in modx_manager_log table Re-up of modxcms#15736 with migration Satisfy phpcs
### 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
### 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 Re-up of #16520 to target 3.0.x ### 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 Re-up of #16520 --------- Co-authored-by: Mark Hamstra <hello@markhamstra.com>
### 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 Re-up of #16520 to target 3.0.x ### 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 Re-up of #16520 --------- Co-authored-by: Mark Hamstra <hello@markhamstra.com>
What does it do?
Add right default value for datatime-type column in modx_manager_log table
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. In this strict modes datatime default value cannot be NULL and must be > '0000-00-00'.
How to test
When setup modx In MySQL 5.7.8 not create index user_occurred at modx_manager_log table.
Try to add index in console
create index user_occurred ON modx_manager_log (user, occurred)
Result
ERROR 1067 (42000): Invalid default value for 'occurred'