Revision e05b8d34
Von Jan Büren vor etwa 13 Jahren hinzugefügt
sql/Pg-upgrade2/customer_add_constraints.sql | ||
---|---|---|
4 | 4 |
-- @charset: utf-8 |
5 | 5 |
-- @ignore: 0 |
6 | 6 |
|
7 |
-- verwaiste Zahlungsbedingungen vorher entfernen: |
|
8 |
update customer set payment_id = NULL where payment_id not in (select id from payment_terms); |
|
9 |
|
|
7 | 10 |
ALTER TABLE customer ADD FOREIGN KEY (payment_id) REFERENCES payment_terms (id); |
8 | 11 |
ALTER TABLE customer ADD FOREIGN KEY (language_id) REFERENCES language (id); |
9 | 12 |
ALTER TABLE customer ADD FOREIGN KEY (business_id) REFERENCES business (id); |
sql/Pg-upgrade2/vendor_add_constraints.sql | ||
---|---|---|
4 | 4 |
-- @charset: utf-8 |
5 | 5 |
-- @ignore: 0 |
6 | 6 |
|
7 |
-- verwaiste Zahlungsbedingungen vorher entfernen |
|
8 |
update vendor set payment_id = NULL where payment_id not in (select id from payment_terms); |
|
9 |
|
|
10 |
|
|
7 | 11 |
ALTER TABLE vendor ADD FOREIGN KEY (payment_id) REFERENCES payment_terms (id); |
8 | 12 |
ALTER TABLE vendor ADD FOREIGN KEY (language_id) REFERENCES language (id); |
9 | 13 |
ALTER TABLE vendor ADD FOREIGN KEY (business_id) REFERENCES business (id); |
Auch abrufbar als: Unified diff
Verwaiste Zahlungsbedingungen in vc vorher auf NULL setzen und danach den neuen Fremdschlüssel