1 -- @tag: delivery_terms
2 -- @description: Neue Tabelle und Spalten für Lieferbedingungen
3 -- @depends: release_3_0_0
6 CREATE TABLE delivery_terms (
7 id integer NOT NULL DEFAULT nextval('id'),
10 sortkey integer NOT NULL,
11 itime timestamp DEFAULT now(),
17 CREATE TRIGGER mtime_delivery_terms
18 BEFORE UPDATE ON delivery_terms
20 EXECUTE PROCEDURE set_mtime();
23 ALTER TABLE oe ADD COLUMN delivery_term_id integer;
24 ALTER TABLE oe ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
26 ALTER TABLE delivery_orders ADD COLUMN delivery_term_id integer;
27 ALTER TABLE delivery_orders ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
29 ALTER TABLE ar ADD COLUMN delivery_term_id integer;
30 ALTER TABLE ar ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
32 ALTER TABLE ap ADD COLUMN delivery_term_id integer;
33 ALTER TABLE ap ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
35 ALTER TABLE customer ADD COLUMN delivery_term_id integer;
36 ALTER TABLE customer ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
38 ALTER TABLE vendor ADD COLUMN delivery_term_id integer;
39 ALTER TABLE vendor ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);