From 212db2f48795726a0a6b557e21c1dea600194af1 Mon Sep 17 00:00:00 2001 From: Thomas Zilio Date: Wed, 30 Aug 2017 15:31:46 +0200 Subject: [PATCH] Bugfix di in_interventi_tecnici --- update/2_3.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update/2_3.php b/update/2_3.php index 32f835212..aa00801f6 100644 --- a/update/2_3.php +++ b/update/2_3.php @@ -155,7 +155,7 @@ if(!empty($fk)){ $database->query("ALTER TABLE `in_interventi` DROP PRIMARY KEY, CHANGE `idintervento` `codice` varchar(25) NOT NULL UNIQUE, ADD PRIMARY KEY (`id`)"); $database->query("DROP INDEX primary_key ON `in_interventi`"); -$database->query("UPDATE `in_interventi_tecnici` SET `idintervento` = (SELECT `id` FROM `in_interventi` WHERE `in_interventi`.`idintervento` = `in_interventi_tecnici`.`idintervento`)"); +$database->query("UPDATE `in_interventi_tecnici` SET `idintervento` = (SELECT `id` FROM `in_interventi` WHERE `in_interventi`.`codice` = `in_interventi_tecnici`.`idintervento`)"); $database->query("ALTER TABLE `in_interventi_tecnici` CHANGE `idintervento` `idintervento` varchar(25)"); $database->query("UPDATE `in_interventi_tecnici` SET `idintervento` = NULL WHERE `idintervento` = 0 OR `idintervento` = ''"); $database->query("ALTER TABLE `in_interventi_tecnici` CHANGE `idintervento` `idintervento` int(11), ADD FOREIGN KEY (`idintervento`) REFERENCES `in_interventi`(`id`) ON DELETE CASCADE");