P5-2963 create new table for samples

This commit is contained in:
Martin
2018-07-31 18:15:55 +02:00
parent 7c77f0c9db
commit e1c68b5ee6
+21
View File
@@ -0,0 +1,21 @@
-- P5-2963 create new table for samples
DROP TABLE IF EXISTS samples;
CREATE TABLE samples
(
id SERIAL PRIMARY KEY,
artno VARCHAR,
material_id INTEGER,
address_id INTEGER
);
ALTER TABLE samples
ADD CONSTRAINT material_fkey
FOREIGN KEY (material_id)
REFERENCES "product-materials"(materialid) MATCH SIMPLE;
ALTER TABLE samples
ADD CONSTRAINT address_fkey
FOREIGN KEY (address_id)
REFERENCES addresses(id) MATCH SIMPLE;