X-Git-Url: http://wagnertech.de/git?p=kivitendo-erp.git;a=blobdiff_plain;f=sql%2FPg-upgrade2%2Fpart_classifications.sql;fp=sql%2FPg-upgrade2%2Fpart_classifications.sql;h=5dc7af8d66e6594530c7e67badd366559ba9b1ec;hp=0000000000000000000000000000000000000000;hb=53593baa211863fbf66540cf1bcc36c8fb37257f;hpb=deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44 diff --git a/sql/Pg-upgrade2/part_classifications.sql b/sql/Pg-upgrade2/part_classifications.sql new file mode 100644 index 000000000..5dc7af8d6 --- /dev/null +++ b/sql/Pg-upgrade2/part_classifications.sql @@ -0,0 +1,19 @@ +-- @tag: part_classifications +-- @description: "zusätzliche Tabelle mit Flags zur Klassifizierung von Artikeln" +-- @depends: release_3_4_1 +CREATE TABLE part_classifications ( + id SERIAL PRIMARY KEY, + description text, + abbreviation text, + used_for_purchase BOOLEAN DEFAULT 't' NOT NULL, + used_for_sale BOOLEAN DEFAULT 't' NOT NULL +); + +INSERT INTO part_classifications values(0,'-------' ,'None (typeabbreviation)','t','t'); +INSERT INTO part_classifications values(1,'Purchase' ,'Purchase (typeabbreviation)' ,'t','f'); +INSERT INTO part_classifications values(2,'Sales' ,'Sales (typeabbreviation)' ,'f','t'); +INSERT INTO part_classifications values(3,'Merchandise','Merchandise (typeabbreviation)','t','t'); +INSERT INTO part_classifications values(4,'Production' ,'Production (typeabbreviation)' ,'f','t'); +SELECT setval('part_classifications_id_seq',4); +ALTER TABLE parts ADD COLUMN classification_id integer DEFAULT 0; +ALTER TABLE parts ADD CONSTRAINT part_classification_id_fkey FOREIGN KEY (classification_id) REFERENCES part_classifications(id);