Closed jackburton79 closed 2 years ago
A new feature was added with 10.0.1 to try and catch issues with the database schema as we noticed some users (mostly from very old versions) had not had all the expected migrations done.
In this case, I don't understand how that table would have those columns. The table was added in 9.4.0 and has kept the same columns. It never should have had a changes_id
column.
Can you verify from the database itself which columns the table has to rule out an issue with the schema checker?
Table definition:
In production, where we still have glpi 9.5.7, the table looks correct:
Was the production database used in testing the 10.0/10.0.1 update?
If so, there may be something very wrong with the migration scripts.
Was the production database used in testing the 10.0/10.0.1 update?
If so, there may be something very wrong with the migration scripts.
Yes, the production database was used to create the testing installation around glpi 9.0, if I remember correctly. Later, the two installation were always updated independently.
Apparently glpi_itils_projects
was originally named glpi_changes_projects
and was renamed in 9.4. Somehow, your test instance renamed the table without changing the columns.
The manual migrations needed:
ALTER TABLE glpi_itils_projects RENAME COLUMN changes_id TO items_id;
ALTER TABLE glpi_itils_projects ADD COLUMN `itemtype` varchar(100) NOT NULL DEFAULT '' AFTER `id`;
UPDATE glpi_itils_projects SET `itemtype` = "Change";
ALTER TABLE glpi_itils_projects ADD UNIQUE `unicity` (`itemtype`, `items_id`, `projects_id`);
This will rename the changes_id column to items_id, add the itemtype column and change the existing records to refer to Changes, and add the new unique key.
Done. Now the glpi:database:check_schema_integrity script doesn't complain anymore. Thanks!
Code of Conduct
Is there an existing issue for this?
Version
10.0.1
Bug description
After migrating to glpi 10.0.1, the system showed a message saying the database is inconsistent. I ran
php bin/console glpi:database:check_schema_integrity
and:How do I fix this ?
Relevant log output
No response
Page URL
No response
Steps To reproduce
No response
Your GLPI setup information
Informazioni sul sistema, l'installazione e la configurazione
Server
GLPI constants
Libraries
LDAP directories
SQL replicas
Notifications
Plugins list
Anything else?
No response