From ddd4d70b4c0f941f804692f7c67d16e083f3f219 Mon Sep 17 00:00:00 2001 From: evarisk-micka Date: Wed, 20 Mar 2024 14:51:11 +0100 Subject: [PATCH] #3684 [SQL] fix: backward delete duplicate --- sql/update.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sql/update.sql b/sql/update.sql index d4c6863b6..caf5492f3 100644 --- a/sql/update.sql +++ b/sql/update.sql @@ -245,3 +245,7 @@ ALTER TABLE llx_digiriskdolibarr_accident DROP COLUMN fk_user_victim; -- 9.14.1 DELETE FROM llx_c_digiriskdolibarr_action_trigger WHERE ref = 'FIREPERMIT_INPROGRESS'; DELETE FROM llx_c_digiriskdolibarr_action_trigger WHERE ref = 'PREVENTIONPLAN_INPROGRESS'; + +-- 9.15.0 +-- Check if ref are duplicate and delete them +DELETE t1 FROM llx_c_digiriskdolibarr_action_trigger t1 JOIN llx_c_digiriskdolibarr_action_trigger t2 WHERE t1.rowid > t2.rowid AND t1.ref = t2.ref;