Fix: Remove deprecated INT display width and DATETIME in SQL schema#111
Open
javierlago-ticgal wants to merge 5 commits into
Open
Fix: Remove deprecated INT display width and DATETIME in SQL schema#111javierlago-ticgal wants to merge 5 commits into
javierlago-ticgal wants to merge 5 commits into
Conversation
…hema Replace INT(11) with INT in all table definitions to comply with GLPI database conventions (MySQL 8.0.17+ deprecation). Replace remaining DATETIME fields with TIMESTAMP. These changes eliminate deprecation warnings raised by DBmysql->checkForDeprecatedTableOptions() during plugin installation.
Remove raw INSERT statements against core table glpi_displaypreferences from the SQL schema file. Use DisplayPreference->add() in hook.php instead, which is resilient to future schema changes in GLPI core. Also adds duplicate check to prevent repeated entries on reinstall.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When installing the plugin on GLPI 10.0.x / 11.0, the DBmysql->checkForDeprecatedTableOptions() method generates multiple deprecation warnings during the execution of the installation SQL file.
Fixed Warnings
INT(11)→INT: MySQL 8.0.17+ deprecated the display width for integer types. GLPI detects INT(11) as a legacy definition and throws a warning for each table, even if the field is already UNSIGNED.DATETIME→TIMESTAMP: GLPI requires the use of TIMESTAMP for date/time fields, as it stores values in UTC and automatically converts them to the session's time zone.Affected Tables
glpi_plugin_archimap_graphsglpi_plugin_archimap_graphs_itemsglpi_plugin_archimap_profilesglpi_plugin_archimap_graphtypesglpi_plugin_archimap_graphstatesglpi_plugin_archimap_graphlevelsglpi_plugin_archimap_configsVerificación
After applying the changes, reinstalling the plugin does not generate any warnings in
ningún warning en
files/_log/php-errors.log.