2 -- @description: Tabelle für in einer Inventur gezählte Artikel
3 -- @depends: warehouse release_3_5_1
6 CREATE TABLE stocktakings (
7 id INTEGER NOT NULL DEFAULT nextval('id'),
8 inventory_id INTEGER REFERENCES inventory(id),
9 warehouse_id INTEGER NOT NULL REFERENCES warehouse(id),
10 bin_id INTEGER NOT NULL REFERENCES bin(id),
11 parts_id INTEGER NOT NULL REFERENCES parts(id),
12 employee_id INTEGER NOT NULL REFERENCES employee(id),
13 qty NUMERIC(25,5) NOT NULL ,
15 chargenumber TEXT NOT NULL DEFAULT '',
17 cutoff_date DATE NOT NULL,
18 itime TIMESTAMP DEFAULT now(),
24 CREATE TRIGGER mtime_stocktakings BEFORE UPDATE ON stocktakings FOR EACH ROW EXECUTE PROCEDURE set_mtime();