2 -- @description: Tabellen und Spalten für Preisfaktoren
3 -- @depends: release_2_4_3
5 CREATE TABLE price_factors (
6 "id" integer DEFAULT nextval('id'::text),
8 "factor" numeric(15,5),
14 ALTER TABLE parts ADD COLUMN price_factor_id integer;
16 ALTER TABLE invoice ADD COLUMN price_factor_id integer;
17 ALTER TABLE invoice ADD COLUMN price_factor numeric(15,5);
18 ALTER TABLE invoice ALTER COLUMN price_factor SET DEFAULT 1;
19 UPDATE invoice SET price_factor = 1;
21 ALTER TABLE invoice ADD COLUMN marge_price_factor numeric(15,5);
22 ALTER TABLE invoice ALTER COLUMN marge_price_factor SET DEFAULT 1;
23 UPDATE invoice SET marge_price_factor = 1;
25 ALTER TABLE orderitems ADD COLUMN price_factor_id integer;
26 ALTER TABLE orderitems ADD COLUMN price_factor numeric(15,5);
27 ALTER TABLE orderitems ALTER COLUMN price_factor SET DEFAULT 1;
28 UPDATE orderitems SET price_factor = 1;
30 ALTER TABLE orderitems ADD COLUMN marge_price_factor numeric(15,5);
31 ALTER TABLE orderitems ALTER COLUMN marge_price_factor SET DEFAULT 1;
32 UPDATE orderitems SET marge_price_factor = 1;
34 INSERT INTO price_factors (description, factor, sortkey) VALUES ('pro 10', 10, 1);
35 INSERT INTO price_factors (description, factor, sortkey) VALUES ('pro 100', 100, 2);
36 INSERT INTO price_factors (description, factor, sortkey) VALUES ('pro 1.000', 1000, 3);