Skip to content

Fix: Remove deprecated INT display width and DATETIME in SQL schema#111

Open
javierlago-ticgal wants to merge 5 commits into
ericferon:masterfrom
javierlago-ticgal:fix/deprecation-warnings-sql-schema
Open

Fix: Remove deprecated INT display width and DATETIME in SQL schema#111
javierlago-ticgal wants to merge 5 commits into
ericferon:masterfrom
javierlago-ticgal:fix/deprecation-warnings-sql-schema

Conversation

@javierlago-ticgal
Copy link
Copy Markdown

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

  1. 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.

  2. DATETIMETIMESTAMP: 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_graphs
  • glpi_plugin_archimap_graphs_items
  • glpi_plugin_archimap_profiles
  • glpi_plugin_archimap_graphtypes
  • glpi_plugin_archimap_graphstates
  • glpi_plugin_archimap_graphlevels
  • glpi_plugin_archimap_configs

Verificación

After applying the changes, reinstalling the plugin does not generate any warnings in
ningún warning en files/_log/php-errors.log.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant