You are not logged in.
Pages: 1
Hello,
Trying to update GLPI and get this error:
9.2 migrate notifications templates - Error during the database query:
INSERT INTO `glpi_notifications_notificationtemplates` (`notifications_id`, `mode`, `notificationtemplates_id`)
SELECT `id`, `mode`, `notificationtemplates_id` FROM `glpi_notifications` -
Error - Duplicate entry '1-mail-6' for key 'unicity'
did you get this problem and how to resolve?
Thanx
Offline
I think this code write from https://github.com/glpi-project/glpi/bl … _91_92.php
if ($DB->fieldExists("glpi_notifications", "mode", false)) {
$query = "REPLACE INTO `glpi_notifications_notificationtemplates`
(`notifications_id`, `mode`, `notificationtemplates_id`)
SELECT `id`, `mode`, `notificationtemplates_id`
FROM `glpi_notifications`";
$DB->queryOrDie($query, "9.2 migrate notifications templates");
//migrate any existing mode before removing the field
$migration->dropField('glpi_notifications', 'mode');
$migration->dropField('glpi_notifications', 'notificationtemplates_id');
$migration->migrationOneTable("glpi_notifications");
}
But the code on release link from main page has this command '$query = "INSERT INTO ...'
After a manual fix I got the following error
9.2 multiple alter in glpi_slas - Error during the database query:
ALTER TABLE `glpi_slas` ADD INDEX `slms_id` (`slms_id`)
- Error - Key column 'slms_id' doesn't exist in table
Last edited by ialex (2017-11-29 10:58:52)
Offline
I Have the same error, and i can't find the way that fix this? Please may be if anybody can help with those errors. thanks.
Offline
I found this answer in order to solve the problem, but doesn't work for me.
Offline
The duplicate records can be found with this SQL script :
SELECT
nt1.id id1, nt2.id id2, nt1.notifications_id nid1, nt2.notifications_id nid2,
nt1.notificationtemplates_id ntid1, nt2.notificationtemplates_id ntid2
FROM
glpi_notifications_notificationtemplates nt1
LEFT OUTER JOIN glpi_notifications_notificationtemplates nt2 ON
nt2.notifications_id=nt1.notifications_id AND
nt2.notificationtemplates_id=nt1.notificationtemplates_id AND
nt2.mode='mailing' AND
nt1.mode='mail'
WHERE
nt2.id IS NOT NULL
ORDER BY
nt1.notifications_id, nt1.notificationtemplates_id;
Offline
Pages: 1