X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44..53593baa211863fbf66540cf1bcc36c8fb37257f:/sql/Pg-upgrade2/create_part_customerprices.sql diff --git a/sql/Pg-upgrade2/create_part_customerprices.sql b/sql/Pg-upgrade2/create_part_customerprices.sql new file mode 100644 index 000000000..98d230346 --- /dev/null +++ b/sql/Pg-upgrade2/create_part_customerprices.sql @@ -0,0 +1,18 @@ +-- @tag: create_part_customerprices +-- @description: VK-Preis für jeden Kunden speichern und das Datum der Eingabe +-- @depends: release_3_5_1 + +CREATE TABLE part_customer_prices ( + id SERIAL PRIMARY KEY, + parts_id integer NOT NULL, + customer_id integer NOT NULL, + customer_partnumber text DEFAULT '', + price numeric(15,5) DEFAULT 0, + sortorder integer DEFAULT 0, + lastupdate date DEFAULT now(), + + FOREIGN KEY (parts_id) REFERENCES parts (id), + FOREIGN KEY (customer_id) REFERENCES customer (id) +); +CREATE INDEX part_customer_prices_parts_id_key ON part_customer_prices USING btree (parts_id); +CREATE INDEX part_customer_prices_customer_id_key ON part_customer_prices USING btree (customer_id);