Add generic ENLYZE power meter pipeline
This commit is contained in:
@@ -46,3 +46,27 @@ CREATE TABLE IF NOT EXISTS material_application_snapshots (
|
||||
|
||||
CREATE INDEX IF NOT EXISTS material_application_snapshots_machine_time_idx
|
||||
ON material_application_snapshots (calculation_id, machine_id, timestamp);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS power_meter_readings (
|
||||
meter text NOT NULL,
|
||||
timestamp timestamptz NOT NULL,
|
||||
energy_total_kwh double precision NOT NULL,
|
||||
energy_delta_kwh double precision NOT NULL,
|
||||
active_power_total_kw double precision NOT NULL,
|
||||
grid_frequency_hz double precision NOT NULL,
|
||||
power_outages double precision NULL,
|
||||
outage_delta double precision NULL,
|
||||
phase_active_power_kw jsonb NOT NULL DEFAULT '{}'::jsonb,
|
||||
PRIMARY KEY (meter, timestamp)
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS power_meter_readings_time_idx
|
||||
ON power_meter_readings (meter, timestamp DESC);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS power_meter_monthly_reports (
|
||||
meter text NOT NULL,
|
||||
month text NOT NULL,
|
||||
report_path text NOT NULL,
|
||||
summary jsonb NOT NULL,
|
||||
generated_at timestamptz NOT NULL DEFAULT now(),
|
||||
PRIMARY KEY (meter, month)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user