1 -- @tag: delivery_terms
2 -- @description: Neue Tabelle und Spalten für Lieferbedingungen
3 -- @depends: release_3_0_0
5 CREATE TABLE delivery_terms (
6 id integer NOT NULL DEFAULT nextval('id'),
9 sortkey integer NOT NULL,
10 itime timestamp DEFAULT now(),
16 CREATE TRIGGER mtime_delivery_terms
17 BEFORE UPDATE ON delivery_terms
19 EXECUTE PROCEDURE set_mtime();
22 ALTER TABLE oe ADD COLUMN delivery_term_id integer;
23 ALTER TABLE oe ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
25 ALTER TABLE delivery_orders ADD COLUMN delivery_term_id integer;
26 ALTER TABLE delivery_orders ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
28 ALTER TABLE ar ADD COLUMN delivery_term_id integer;
29 ALTER TABLE ar ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
31 ALTER TABLE ap ADD COLUMN delivery_term_id integer;
32 ALTER TABLE ap ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
34 ALTER TABLE customer ADD COLUMN delivery_term_id integer;
35 ALTER TABLE customer ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
37 ALTER TABLE vendor ADD COLUMN delivery_term_id integer;
38 ALTER TABLE vendor ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);