X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/a96b6e954640c26516962ad7cee25a98b90eb883..01f6500562203f8b7e0ed13d6b969c1ac47f51e0:/sql/Pg-upgrade2/assembly_inventory_part.sql

diff --git a/sql/Pg-upgrade2/assembly_inventory_part.sql b/sql/Pg-upgrade2/assembly_inventory_part.sql
new file mode 100644
index 000000000..130191189
--- /dev/null
+++ b/sql/Pg-upgrade2/assembly_inventory_part.sql
@@ -0,0 +1,15 @@
+-- @tag: assembly_inventory_part
+-- @description: Tabelle fÃ¼r die wirklich verbauten Einzelteile eines Erzeugnis
+-- @depends: warehouse release_3_5_6_1
+
+
+CREATE TABLE assembly_inventory_part (
+       inventory_part_id        INTEGER        REFERENCES inventory(id),
+       inventory_assembly_id    INTEGER        REFERENCES inventory(id),
+       itime                    TIMESTAMP      DEFAULT now(),
+       mtime                    TIMESTAMP,
+
+       PRIMARY KEY (inventory_assembly_id, inventory_part_id)
+);
+
+CREATE TRIGGER mtime_assembly_inventory_part BEFORE UPDATE ON assembly_inventory_part FOR EACH ROW EXECUTE PROCEDURE set_mtime();
