glpi-project / glpi

GLPI is a Free Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.
https://glpi-project.org
GNU General Public License v3.0
4.29k stars 1.29k forks source link

console db:check shows differences but console db:update shows no differences #9317

Closed patriciocs1979 closed 3 years ago

patriciocs1979 commented 3 years ago

When I run console db:check I get a lot of differences however when I run console db:update I get the "No migration needed message". My db is MariaDB hosed in the same server thatn GLPi

In my install I get this for console db:check

[xxxxglpi]# php bin/console db:check
Table schema differs for table "glpi_items_softwareversions".
--- Original
+++ New
@@ @@
   `is_dynamic` tinyint(1) not null default '0'
   `date_install` date default null
   primary key (`id`)
-  unique key `unicity` (`itemtype`,`items_id` ,`softwareversions_id`)
Table schema differs for table "glpi_impactrelations".
--- Original
+++ New
@@ @@
 create table `glpi_impactrelations` (
   `id` int(11) not null auto_increment
-  `itemtype_source` varchar(255) not null default '' collate 'utf8_unicode_ci'
+  `itemtype_source` varchar(255) not null default ''
   `items_id_source` int(11) not null default '0'
-  `itemtype_impacted` varchar(255) not null default '' collate 'utf8_unicode_ci'
+  `itemtype_impacted` varchar(255) not null default ''
   `items_id_impacted` int(11) not null default '0'
   primary key (`id`)
-  unique key `unicity` (
-    `itemtype_source`
-    `items_id_source`
-    `itemtype_impacted`
-    `items_id_impacted`
-  )
+  unique key `unicity` (`itemtype_source`,`items_id_source`,`itemtype_impacted`,`items_id_impacted`)
Table schema differs for table "glpi_impactcompounds".
--- Original
+++ New
@@ @@
 create table `glpi_impactcompounds` (
   `id` int(11) not null auto_increment
-  `name` varchar(255) null default '' collate 'utf8_unicode_ci'
-  `color` varchar(255) not null default '' collate 'utf8_unicode_ci'
+  `name` varchar(255) default ''
+  `color` varchar(255) not null default ''
   primary key (`id`)
Table schema differs for table "glpi_impactitems".
--- Original
+++ New
@@ @@
 create table `glpi_impactitems` (
   `id` int(11) not null auto_increment
-  `itemtype` varchar(255) not null default '' collate 'utf8_unicode_ci'
+  `itemtype` varchar(255) not null default ''
   `items_id` int(11) not null default '0'
   `parent_id` int(11) not null default '0'
-  `impactcontexts_id` int(11) not null default '0'
-  `is_slave` tinyint(1) not null default '1'
+  `zoom` float not null default '0'
+  `pan_x` float not null default '0'
+  `pan_y` float not null default '0'
+  `impact_color` varchar(255) not null default ''
+  `depends_color` varchar(255) not null default ''
+  `impact_and_depends_color` varchar(255) not null default ''
+  `position_x` float not null default '0'
+  `position_y` float not null default '0'
+  `show_depends` tinyint(4) not null default '1'
+  `show_impact` tinyint(4) not null default '1'
+  `max_depth` int(11) not null default '5'
   primary key (`id`)
-  unique key `unicity` (
-    `itemtype`
-    `items_id`
-  )
+  unique key `unicity` (`itemtype`,`items_id`)
Table schema differs for table "glpi_impactcontexts".
--- Original
+++ New
@@ @@
 create table `glpi_impactcontexts` (
   `id` int(11) not null auto_increment
-  `positions` text not null collate 'utf8_unicode_ci'
+  `positions` text not null default ''
   `zoom` float not null default '0'
   `pan_x` float not null default '0'
   `pan_y` float not null default '0'
-  `impact_color` varchar(255) not null default '' collate 'utf8_unicode_ci'
-  `depends_color` varchar(255) not null default '' collate 'utf8_unicode_ci'
-  `impact_and_depends_color` varchar(255) not null default '' collate 'utf8_unicode_ci'
+  `impact_color` varchar(255) not null default ''
+  `depends_color` varchar(255) not null default ''
+  `impact_and_depends_color` varchar(255) not null default ''
   `show_depends` tinyint(1) not null default '1'
   `show_impact` tinyint(1) not null default '1'
   `max_depth` int(11) not null default '5'
Table schema differs for table "glpi_domains".
--- Original
+++ New
@@ @@
   `entities_id` int(11) not null default '0'
   `is_recursive` tinyint(1) not null default '0'
   `domaintypes_id` int(11) not null default '0'
-  `date_expiration` timestamp  null default null
+  `date_expiration` timestamp null default null
   `users_id_tech` int(11) not null default '0'
   `groups_id_tech` int(11) not null default '0'
   `others` varchar(255) default null
Table schema differs for table "glpi_rulecriterias".
--- Original
+++ New
@@ @@
   `rules_id` int(11) not null default '0'
   `criteria` varchar(255) default null
   `condition` int(11) not null default '0'
-  `pattern` text default null
+  `pattern` text
   primary key (`id`)
Table schema differs for table "glpi_itilsolutions".
--- Original
+++ New
@@ @@
   `itemtype` varchar(100) not null
   `items_id` int(11) not null default '0'
   `solutiontypes_id` int(11) not null default '0'
-  `solutiontype_name` varchar(255) null default null
+  `solutiontype_name` varchar(255) default null
   `content` longtext
   `date_creation` timestamp null default null
   `date_mod` timestamp null default null
   `date_approval` timestamp null default null
   `users_id` int(11) not null default '0'
-  `user_name` varchar(255) null default null
+  `user_name` varchar(255) default null
   `users_id_editor` int(11) not null default '0'
   `users_id_approval` int(11) not null default '0'
-  `user_name_approval` varchar(255) null default null
+  `user_name_approval` varchar(255) default null
   `status` int(11) not null default '1'
-  `itilfollowups_id` int(11) default null
+  `itilfollowups_id` int(11) default null
   primary key (`id`)
Table schema differs for table "glpi_racks".
--- Original
+++ New
@@ @@
   `is_deleted` tinyint(1) not null default '0'
   `dcrooms_id` int(11) not null default '0'
   `room_orientation` int(11) not null default '0'
-  `position` varchar(50)
+  `position` varchar(50) default null
   `bgcolor` varchar(7) default null
   `max_power` int(11) not null default '0'
   `mesured_power` int(11) not null default '0'
Table schema differs for table "glpi_items_racks".
--- Original
+++ New
@@ @@
   `itemtype` varchar(255) not null
   `items_id` int(11) not null
   `position` int(11) not null
-  `orientation` tinyint(1)
+  `orientation` tinyint(1) default null
   `bgcolor` varchar(7) default null
   `hpos` tinyint(1) not null default '0'
   `is_reserved` tinyint(1) not null default '0'
Table schema differs for table "glpi_enclosures".
--- Original
+++ New
@@ @@
   `is_template` tinyint(1) not null default '0'
   `template_name` varchar(255) default null
   `is_deleted` tinyint(1) not null default '0'
-  `orientation` tinyint(1)
+  `orientation` tinyint(1) default null
   `power_supplies` tinyint(1) not null default '0'
   `states_id` int(11) not null default '0'
   `comment` text
Table schema differs for table "glpi_itilfollowuptemplates".
--- Original
+++ New
@@ @@
 create table `glpi_itilfollowuptemplates` (
-   `id` int(11) not null auto_increment
-   `date_creation` timestamp null default null
-   `date_mod` timestamp null default null
-   `entities_id` int(11) not null default '0'
-   `is_recursive` tinyint(1) not null default '0'
-   `name` varchar(255) null default null collate 'utf8_unicode_ci'
-   `content` text null collate 'utf8_unicode_ci'
-   `requesttypes_id` int(11) not null default '0'
-   `is_private` tinyint(1) not null default '0'
-   `comment` text null collate 'utf8_unicode_ci'
-   primary key (`id`)
+  `id` int(11) not null auto_increment
+  `date_creation` timestamp null default null
+  `date_mod` timestamp null default null
+  `entities_id` int(11) not null default '0'
+  `is_recursive` tinyint(1) not null default '0'
+  `name` varchar(255) default null
+  `content` text
+  `requesttypes_id` int(11) not null default '0'
+  `is_private` tinyint(1) not null default '0'
+  `comment` text
+  primary key (`id`)
Table schema differs for table "glpi_planningexternaleventtemplates".
--- Original
+++ New
@@ @@
 create table `glpi_planningexternaleventtemplates` (
-   `id` int(11) not null auto_increment
-   `entities_id` int(11) not null default '0'
-   `name` varchar(255) default null
-   `text` text
-   `comment` text
-   `duration` int(11) not null default '0'
-   `before_time` int(11) not null default '0'
-   `rrule` text
-   `state` int(11) not null default '0'
-   `planningeventcategories_id` int(11) not null default '0'
-   `background` tinyint(1) not null default '0'
-   `date_mod` timestamp null default null
-   `date_creation` timestamp null default null
-   primary key (`id`)
+  `id` int(11) not null auto_increment
+  `entities_id` int(11) not null default '0'
+  `name` varchar(255) default null
+  `text` text
+  `comment` text
+  `duration` int(11) not null default '0'
+  `before_time` int(11) not null default '0'
+  `rrule` text
+  `state` int(11) not null default '0'
+  `planningeventcategories_id` int(11) not null default '0'
+  `background` tinyint(1) not null default '0'
+  `date_mod` timestamp null default null
+  `date_creation` timestamp null default null
+  primary key (`id`)
Table schema differs for table "glpi_items_kanbans".
--- Original
+++ New
@@ @@
 create table `glpi_items_kanbans` (
-   `id` int(11) not null auto_increment
-   `itemtype` varchar(100) not null
-   `items_id` int(11) default null
-   `users_id` int(11) not null
-   `state` text
-   `date_mod` timestamp null default null
-   `date_creation` timestamp null default null
-   primary key (`id`)
-   unique key `unicity` (`itemtype`,`items_id`,`users_id`)
+  `id` int(11) not null auto_increment
+  `itemtype` varchar(100) not null
+  `items_id` int(11) default null
+  `users_id` int(11) not null
+  `state` text
+  `date_mod` timestamp null default null
+  `date_creation` timestamp null default null
+  primary key (`id`)
+  unique key `unicity` (`itemtype`,`items_id`,`users_id`)
Table schema differs for table "glpi_vobjects".
--- Original
+++ New
@@ @@
 create table `glpi_vobjects` (
-   `id` int(11) not null auto_increment
-   `itemtype` varchar(100) default null
-   `items_id` int(11) not null default '0'
-   `data` text
-   `date_mod` timestamp null default null
-   `date_creation` timestamp null default null
-   primary key (`id`)
-   unique key `unicity` (`itemtype`,`items_id`)
+  `id` int(11) not null auto_increment
+  `itemtype` varchar(100) default null
+  `items_id` int(11) not null default '0'
+  `data` text
+  `date_mod` timestamp null default null
+  `date_creation` timestamp null default null
+  primary key (`id`)
+  unique key `unicity` (`itemtype`,`items_id`)
Table schema differs for table "glpi_domaintypes".
--- Original
+++ New
@@ @@
 create table `glpi_domaintypes` (
-  `id` int(11) not null        auto_increment
+  `id` int(11) not null auto_increment
   `name` varchar(255) default null
-  `entities_id` int(11) not null        default '0'
+  `entities_id` int(11) not null default '0'
   `is_recursive` tinyint(1) not null default '0'
   `comment` text
   primary key (`id`)
Table schema differs for table "glpi_domainrelations".
--- Original
+++ New
@@ @@
 create table `glpi_domainrelations` (
-  `id` int(11) not null        auto_increment
+  `id` int(11) not null auto_increment
   `name` varchar(255) default null
-  `entities_id` int(11) not null        default '0'
+  `entities_id` int(11) not null default '0'
   `is_recursive` tinyint(1) not null default '0'
   `comment` text
   primary key (`id`)
Table schema differs for table "glpi_domainrecordtypes".
--- Original
+++ New
@@ @@
 create table `glpi_domainrecordtypes` (
-  `id` int(11) not null        auto_increment
+  `id` int(11) not null auto_increment
   `name` varchar(255) default null
-  `entities_id` int(11) not null        default '0'
+  `entities_id` int(11) not null default '0'
   `is_recursive` tinyint(1) not null default '0'
   `comment` text
   primary key (`id`)
Table schema differs for table "glpi_appliances".
--- Original
+++ New
@@ @@
   `serial` varchar(255) default null
   `otherserial` varchar(255) default null
   `is_helpdesk_visible` tinyint(1) not null default '1'
-  primary key  (`id`)
+  primary key (`id`)
   unique key `unicity` (`externalidentifier`)

But when I run console db:update I get this:

[xxxx glpi]# php bin/console db:update
Some optional system requirements are missing. Run "php bin/console glpi:system:check_requirements" for more details.
+-----------------------+-----------+----------+
|                       | Current   | Objetivo |
+-----------------------+-----------+----------+
| Database host         | 127.0.0.1 |          |
| Database name         | glpi      |          |
| Database user         | glpi      |          |
| GLPI version          | 9.5.5     | 9.5.5    |
| GLPI database version | 9.5.5     | 9.5.5    |
+-----------------------+-----------+----------+
No migration needed.

I installed GLPi 9.3.0 one year ago and from that version I ave been updating until current 9.5.5 version

To reproduce

Run the commands console db:check and then console db:update

Expected behavior

Database should be updated with console db:update if there are diffences showed with the console db:check command

Logs

Your GLPI setup (you can find it in Setup > General menu, System tab)

[code]   GLPI 9.5.5 ( => /usr/share/glpi) Installation mode: RPM
--

Operating system: Linux xxxxxxxx 3.10.0-1160.31.1.el7.x86_64 #1 SMP Thu Jun 10 13:32:12 UTC 2021 x86_64 PHP 7.4.20 apache2handler (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, apcu, bcmath, bz2,    calendar, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, intl, json, ldap, libxml,    mbstring, mysqli, mysqlnd, openssl, pcre, pdo_mysql, pdo_sqlite, posix, session, shmop, snmp, soap, sockets, sodium, sqlite3,   standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib) Setup: max_execution_time="180" memory_limit="512M" post_max_size="128M" safe_mode="" session.save_handler="files"     upload_max_filesize="256M"  Software: Apache/2.4.48 (codeit) OpenSSL/1.1.1k PHP/7.4.20 ()   Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36 Edg/91.0.864.71 Server Software: MariaDB Server     Server Version: 10.4.20-MariaDB     Server SQL Mode:    Parameters: xxxxxxx Host info: 127.0.0.1 via TCP/IP      PHP version is at least 7.2.0 - Perfect! Sessions support is available - Perfect! Allocated memory > 64 Mio - Perfect! mysqli extension is installed ctype extension is installed fileinfo extension is installed json extension is installed mbstring extension is installed iconv extension is installed zlib extension is installed curl extension is installed gd extension is installed simplexml extension is installed intl extension is installed ldap extension is installed apcu extension is installed Zend OPcache extension is installed xmlrpc extension is installed CAS extension is not present exif extension is installed zip extension is installed bz2 extension is installed sodium extension is installed Database version seems correct (10.4.20) - Perfect! Timezones seems loaded in database The log file has been created successfully. Write access to /var/lib/glpi/files/_cache has been validated. Write access to /etc/glpi has been validated. Write access to /var/lib/glpi/files/_cron has been validated. Write access to /var/lib/glpi/files has been validated. Write access to /var/lib/glpi/files/_dumps has been validated. Write access to /var/lib/glpi/files/_graphs has been validated. Write access to /var/lib/glpi/files/_lock has been validated. Write access to /var/lib/glpi/files/_pictures has been validated. Write access to /var/lib/glpi/files/_plugins has been validated. Write access to /var/lib/glpi/files/_rss has been validated. Write access to /var/lib/glpi/files/_sessions has been validated. Write access to /var/lib/glpi/files/_tmp has been validated. Write access to /var/lib/glpi/files/_uploads has been validated. Write access to /usr/share/glpi/marketplace has been validated. 

GLPI_ROOT: /usr/share/glpi GLPI_CONFIG_DIR: /etc/glpi GLPI_VAR_DIR: /var/lib/glpi/files GLPI_LOG_DIR: /var/log/glpi GLPI_HTMLAWED: /usr/share/php/htmLawed/htmLawed.php GLPI_FONT_FREESANS: /usr/share/fonts/gnu-free/FreeSans.ttf GLPI_SYSTEM_CRON: 1 GLPI_INSTALL_MODE: RPM GLPI_MARKETPLACE_DIR: /usr/share/glpi/marketplace GLPI_USE_CSRF_CHECK: 1 GLPI_CSRF_EXPIRES: 7200 GLPI_CSRF_MAX_TOKENS: 100 GLPI_USE_IDOR_CHECK: 1 GLPI_IDOR_EXPIRES: 7200 GLPI_ALLOW_IFRAME_IN_RICH_TEXT:  GLPI_TELEMETRY_URI: https://telemetry.glpi-project.org GLPI_NETWORK_MAIL: glpi@teclib.com GLPI_NETWORK_SERVICES: https://services.glpi-network.com GLPI_MARKETPLACE_PRERELEASES:  GLPI_MARKETPLACE_ALLOW_OVERRIDE: 1 GLPI_MARKETPLACE_MANUAL_DOWNLOADS: 1 GLPI_USER_AGENT_EXTRA_COMMENTS:  GLPI_AJAX_DASHBOARD: 1 GLPI_CALDAV_IMPORT_STATE: 0 GLPI_DEMO_MODE: 0 GLPI_FORCE_EMPTY_SQL_MODE: 1 GLPI_DOC_DIR: /var/lib/glpi/files GLPI_CACHE_DIR: /var/lib/glpi/files/_cache GLPI_CRON_DIR: /var/lib/glpi/files/_cron GLPI_DUMP_DIR: /var/lib/glpi/files/_dumps GLPI_GRAPH_DIR: /var/lib/glpi/files/_graphs GLPI_LOCAL_I18N_DIR: /var/lib/glpi/files/_locales GLPI_LOCK_DIR: /var/lib/glpi/files/_lock GLPI_PICTURE_DIR: /var/lib/glpi/files/_pictures GLPI_PLUGIN_DOC_DIR: /var/lib/glpi/files/_plugins GLPI_RSS_DIR: /var/lib/glpi/files/_rss GLPI_SESSION_DIR: /var/lib/glpi/files/_sessions GLPI_TMP_DIR: /var/lib/glpi/files/_tmp GLPI_UPLOAD_DIR: /var/lib/glpi/files/_uploads GLPI_NETWORK_REGISTRATION_API_URL: https://services.glpi-network.com/api/registration/ GLPI_MARKETPLACE_PLUGINS_API_URI: https://services.glpi-network.com/api/glpi-plugins/ GLPI_I18N_DIR: /usr/share/glpi/locales GLPI_VERSION: 9.5.5 GLPI_SCHEMA_VERSION: 9.5.5 GLPI_MIN_PHP: 7.2.0 GLPI_YEAR: 2021

htmlawed/htmlawed version 1.2.5 in (/usr/share/glpi/vendor/htmlawed/htmlawed) phpmailer/phpmailer version 6.1.6 in (/usr/share/glpi/vendor/phpmailer/phpmailer/src) simplepie/simplepie version 1.5.6 in (/usr/share/glpi/vendor/simplepie/simplepie/library) tecnickcom/tcpdf version 6.3.5 in (/usr/share/glpi/vendor/tecnickcom/tcpdf) michelf/php-markdown in (/usr/share/glpi/vendor/michelf/php-markdown/Michelf) true/punycode in (/usr/share/glpi/vendor/true/punycode/src) iamcal/lib_autolink in (/usr/share/glpi/vendor/iamcal/lib_autolink) sabre/dav in (/usr/share/glpi/vendor/sabre/dav/lib/DAV) sabre/http in (/usr/share/glpi/vendor/sabre/http/lib) sabre/uri in (/usr/share/glpi/vendor/sabre/uri/lib) sabre/vobject in (/usr/share/glpi/vendor/sabre/vobject/lib) laminas/laminas-cache in (/usr/share/glpi/vendor/laminas/laminas-cache/src) laminas/laminas-i18n in (/usr/share/glpi/vendor/laminas/laminas-i18n/src) laminas/laminas-serializer in (/usr/share/glpi/vendor/laminas/laminas-serializer/src) monolog/monolog in (/usr/share/glpi/vendor/monolog/monolog/src/Monolog) sebastian/diff in (/usr/share/glpi/vendor/sebastian/diff/src) elvanto/litemoji in (/usr/share/glpi/vendor/elvanto/litemoji/src) symfony/console in (/usr/share/glpi/vendor/symfony/console) scssphp/scssphp in (/usr/share/glpi/vendor/scssphp/scssphp/src) laminas/laminas-mail in (/usr/share/glpi/vendor/laminas/laminas-mail/src/Protocol) laminas/laminas-mime in (/usr/share/glpi/vendor/laminas/laminas-mime/src) rlanvin/php-rrule in (/usr/share/glpi/vendor/rlanvin/php-rrule/src) blueimp/jquery-file-upload in (/usr/share/glpi/vendor/blueimp/jquery-file-upload/server/php) ramsey/uuid in (/usr/share/glpi/vendor/ramsey/uuid/src) psr/log in (/usr/share/glpi/vendor/psr/log/Psr/Log) psr/simple-cache in (/usr/share/glpi/vendor/psr/simple-cache/src) mexitek/phpcolors in (/usr/share/glpi/vendor/mexitek/phpcolors/src/Mexitek/PHPColors) guzzlehttp/guzzle in (/usr/share/glpi/vendor/guzzlehttp/guzzle/src) guzzlehttp/psr7 in (/usr/share/glpi/vendor/guzzlehttp/psr7/src) wapmorgan/unified-archive in (/usr/share/glpi/vendor/wapmorgan/unified-archive/src) paragonie/sodium_compat in (/usr/share/glpi/vendor/paragonie/sodium_compat/src)

Server: 'xxxxxx', Port: '389', BaseDN: 'OU=CL,OU=SouthAmerica,OU=BV,DC=laz,DC=bvcorp,DC=corp',      Connection filter: '(&(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))', RootDN:         'xxxxx', Use TLS: none

Way of sending emails: SMTP+SSL (xxxx
Name: 'helpdesk@xxxxxx' Active: Yes     Server: '{xxxxx/pop/notls}' Login: 'helpdesk' Password: Yes

fields               Name: Additionnal fields             Version: 1.12.6     State: Enabled    behaviors            Name: Behaviours                     Version: 2.4.1      State: Enabled    datainjection        Name: Data injection                 Version: 2.9.0      State: Enabled    formcreator          Name: Form Creator                   Version: 2.11.4     State: Installed / not activated  fusioninventory      Name: FusionInventory                Version: 9.5.0+1.0  State: Enabled    addressing           Name: IP Adressing                   Version: 2.9.0      State: Enabled    tasklists            Name: Lista de tareas                Version: 1.6.0      State: Enabled    mreporting           Name: More Reporting                 Version: 1.7.3      State: Enabled    satisfaction         Name: More satisfaction              Version: 1.5.1      State: Installed / not activated  moreticket           Name: More ticket                    Version: 1.6.1      State: Enabled    printercounters      Name: Printer counters               Version: 1.7.0      State: Installed / not activated  protocolsmanager     Name: Protocols manager              Version: 1.4        State: Enabled    reports              Name: Reportes                       Version: 1.14.0     State: Enabled    screenshot           Name: Screenshot                     Version: 1.1.3      State: Enabled
[/code]
trasher commented 3 years ago

Hi,

Please see https://github.com/glpi-project/glpi/issues/9203#issuecomment-867548286