X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/b1b4e6878345cc1a8b590dd7362e4a50048f2417..c7ad671d22e558e157797af7d787c8df499be1b4:/sql/Pg-upgrade2/customer_add_constraints.sql

diff --git a/sql/Pg-upgrade2/customer_add_constraints.sql b/sql/Pg-upgrade2/customer_add_constraints.sql
index 89ca9d628..65d338645 100644
--- a/sql/Pg-upgrade2/customer_add_constraints.sql
+++ b/sql/Pg-upgrade2/customer_add_constraints.sql
@@ -4,8 +4,10 @@
 -- @charset: utf-8
 -- @ignore: 0
 
--- verwaiste Zahlungsbedingungen vorher entfernen:
-update customer set payment_id = NULL where payment_id not in (select id from payment_terms);
+-- verwaiste EintrÃ¤ge vorher entfernen
+UPDATE customer SET payment_id  = NULL WHERE payment_id  NOT IN (SELECT id FROM payment_terms);
+UPDATE customer SET language_id = NULL WHERE language_id NOT IN (SELECT id FROM language);
+UPDATE customer SET business_id = NULL WHERE business_id NOT IN (SELECT id FROM business);
 
 ALTER TABLE customer ADD FOREIGN KEY (payment_id) REFERENCES payment_terms (id);
 ALTER TABLE customer ADD FOREIGN KEY (language_id) REFERENCES language (id);
