From dc59476f1c3287836a90efdabb4d2bfdeeab22df Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Mon, 9 Aug 2021 14:06:50 +0200 Subject: [PATCH] =?utf8?q?Fix=20f=C3=BCr=20redmine=20#483?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Falls es verwaiste abweichende Lieferadressen gibt, werden alle Benutzerdefinierten Variablen gelöscht. --- sql/Pg-upgrade2/delete_cvars_on_trans_deletion_add_shipto.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/Pg-upgrade2/delete_cvars_on_trans_deletion_add_shipto.sql b/sql/Pg-upgrade2/delete_cvars_on_trans_deletion_add_shipto.sql index ab1d1a4f5..d2f887b43 100644 --- a/sql/Pg-upgrade2/delete_cvars_on_trans_deletion_add_shipto.sql +++ b/sql/Pg-upgrade2/delete_cvars_on_trans_deletion_add_shipto.sql @@ -4,7 +4,7 @@ -- 1.6 Alle benutzerdefinierten Variablen löschen, für die es keine -- Einträge in shipto mehr gibt. -DELETE FROM custom_variables WHERE EXISTS +DELETE FROM custom_variables WHERE id IN (SELECT cv.id FROM custom_variables cv LEFT JOIN custom_variable_configs cvc ON (cv.config_id = cvc.id) WHERE module LIKE 'ShipTo' AND NOT EXISTS (SELECT shipto_id FROM shipto WHERE shipto_id = cv.trans_id)); -- 2.20.1