Persist material consumption snapshots
This commit is contained in:
1 parent
7c029759f5
commit
ae13c3c35a
9 files changed
+303
-17
No files matched your search
@@ -0,0 +1,13 @@
|
||||
CREATE TABLE IF NOT EXISTS material_consumption_snapshots (
|
||||
timestamp timestamptz NOT NULL,
|
||||
calculation_id text NOT NULL,
|
||||
machine_id text NOT NULL,
|
||||
production_order text NOT NULL,
|
||||
run_id text NOT NULL,
|
||||
consumption_kg double precision NOT NULL,
|
||||
PRIMARY KEY (calculation_id, machine_id, production_order, timestamp)
|
||||
);
|
||||
|
||||
-- Machine time series across orders; the primary key covers a specific order.
|
||||
CREATE INDEX IF NOT EXISTS material_consumption_snapshots_machine_time_idx
|
||||
ON material_consumption_snapshots (calculation_id, machine_id, timestamp);
|
||||
Reference in new issue
Block a user