X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/e05b8d340be3f8b7516ae37f4532977d3860c10d..fb1da87cc688c778ea8fcb9a2baf69aced38d875:/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..60f73bbb7 100644
--- a/sql/Pg-upgrade2/customer_add_constraints.sql
+++ b/sql/Pg-upgrade2/customer_add_constraints.sql
@@ -1,11 +1,12 @@
 -- @tag: customer_add_constraints
 -- @description: ZusÃ¤tzliche FremdschlÃ¼ssel fÃ¼r Sprache, Kundentyp und Zahlungskonditionen
 -- @depends: release_2_6_3
--- @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);
