You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2023-07-11 10:18:30

swknf_msy
Member
Registered: 2023-07-11
Posts: 3

How to fix schema differ for table "gpli_itilfollowups"

Hi, I'm a long user of GLPI, maybe since 0.84 or even older, so my databse has some problems.

Here when trying to upgrade from 10.0.6 to 10.0.8 and ran db:check I got this output :

Le schéma diffère pour la table "glpi_itilfollowups".
--- Schéma de base de données attendu
+++ Schéma de base de données actuel
@@ @@
   `is_private` tinyint NOT NULL DEFAULT 0,
   `items_id` int NOT NULL DEFAULT 0,
   `itemtype` varchar(100) NOT NULL,
-  `requesttypes_id` int unsigned NOT NULL DEFAULT 0,
+  `realtime` float NOT NULL DEFAULT 0,
   `sourceitems_id` int NOT NULL DEFAULT 0,
   `sourceof_items_id` int NOT NULL DEFAULT 0,
   `timeline_position` tinyint NOT NULL DEFAULT 0,
@@ @@
   KEY `date` (`date`),
   KEY `is_private` (`is_private`),
   KEY `item` (`itemtype`,`items_id`),
-  KEY `requesttypes_id` (`requesttypes_id`),
   KEY `sourceitems_id` (`sourceitems_id`),
   KEY `sourceof_items_id` (`sourceof_items_id`),
   KEY `users_id_editor` (`users_id_editor`),
   KEY `users_id` (`users_id`)
)

I understand that column +  `realtime` float NOT NULL DEFAULT 0 should be added and the ones with de minus sign should be removed ( or am I wrong here ? )
What I do not understand is how to achieve that. I'm not practising SQL query on a regular basis.
What bother me also is that when I show the columns form the table it seems to already be ok ( at least under my understanding )

MariaDB [glpi]> show columns from glpi_itilfollowups
    -> ;
+-------------------+------------------+------+-----+---------+----------------+
| Field             | Type             | Null | Key | Default | Extra          |
+-------------------+------------------+------+-----+---------+----------------+
| id                | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| itemtype          | varchar(100)     | NO   | MUL | NULL    |                |
| items_id          | int(10) unsigned | NO   |     | 0       |                |
| date              | timestamp        | YES  | MUL | NULL    |                |
| users_id          | int(10) unsigned | NO   | MUL | 0       |                |
| users_id_editor   | int(10) unsigned | NO   | MUL | 0       |                |
| content           | longtext         | YES  |     | NULL    |                |
| is_private        | tinyint(1)       | NO   | MUL | 0       |                |
| realtime          | float            | NO   |     | 0       |                |
| date_mod          | timestamp        | YES  | MUL | NULL    |                |
| date_creation     | timestamp        | YES  | MUL | NULL    |                |
| timeline_position | tinyint(1)       | NO   |     | 0       |                |
| sourceitems_id    | int(10) unsigned | NO   | MUL | 0       |                |
| sourceof_items_id | int(10) unsigned | NO   | MUL | 0       |                |
+-------------------+------------------+------+-----+---------+----------------+

so what should I do to correct this problem ?

thanks for input.

Offline

#2 2023-07-11 10:54:04

swknf_msy
Member
Registered: 2023-07-11
Posts: 3

Re: How to fix schema differ for table "gpli_itilfollowups"

Meh, nevermind. I fixed it by myself.
for references :

I misundertood the meaning of plus and minus sign. It is reversed.
when a minus is shown it is a missing item that should be added.
when a plus is shown it is an extra item that should be removed.

hence that is the SQL statement thrown to MariaDB to fix the schema issue :

MariaDB [glpi]> ALTER TABLE `glpi_itilfollowups` ADD `requesttypes_id` int unsigned NOT NULL DEFAULT 0 AFTER `itemtype`;
Query OK, 0 rows affected (0,011 sec)
Records: 0  Duplicates: 0  Warnings: 0

to create the missing column requesttypes_id

MariaDB [glpi]> ALTER TABLE `glpi_itilfollowups` DROP COLUMN `realtime`;
Query OK, 0 rows affected (0,009 sec)
Records: 0  Duplicates: 0  Warnings: 0

to remove the not anymore nedded column realtime

MariaDB [glpi]> ALTER TABLE `glpi_itilfollowups` ADD KEY `requesttypes_id` (`requesttypes_id`);
Query OK, 0 rows affected (0,069 sec)
Records: 0  Duplicates: 0  Warnings: 0

to add the missing index for requesttypes_id

Hope this post can help someone.

Regards

Offline

Board footer

Powered by FluxBB