X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/e05b8d340be3f8b7516ae37f4532977d3860c10d..0bc6b1d1f9b96054d9ae4098930ec186be8d7738:/sql/Pg-upgrade2/vendor_add_constraints.sql?ds=sidebyside

diff --git a/sql/Pg-upgrade2/vendor_add_constraints.sql b/sql/Pg-upgrade2/vendor_add_constraints.sql
index 3d3a81657..bddd627f4 100644
--- a/sql/Pg-upgrade2/vendor_add_constraints.sql
+++ b/sql/Pg-upgrade2/vendor_add_constraints.sql
@@ -1,12 +1,12 @@
 -- @tag: vendor_add_constraints
 -- @description: ZusÃ¤tzliche FremdschlÃ¼ssel fÃ¼r Sprache, Lieferantentyp und Zahlungskonditionen
 -- @depends: release_2_6_3
--- @charset: utf-8
 -- @ignore: 0
 
--- verwaiste Zahlungsbedingungen vorher entfernen
-update vendor set payment_id = NULL where payment_id not in (select id from payment_terms);
-
+-- verwaiste EintrÃ¤ge vorher entfernen
+UPDATE vendor SET payment_id  = NULL WHERE payment_id  NOT IN (SELECT id FROM payment_terms);
+UPDATE vendor SET language_id = NULL WHERE language_id NOT IN (SELECT id FROM language);
+UPDATE vendor SET business_id = NULL WHERE business_id NOT IN (SELECT id FROM business);
 
 ALTER TABLE vendor ADD FOREIGN KEY (payment_id) REFERENCES payment_terms (id);
 ALTER TABLE vendor ADD FOREIGN KEY (language_id) REFERENCES language (id);
