Add solar table migration

Records hourly solar panel readings imported from /home/pmp/ai/solar/csv
by the sibling repo's import-csv.mjs. Schema includes only the 8
columns that always carry data; the 5 always-empty CSV columns are
dropped.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-19 10:40:21 +02:00
co-authored by Claude Opus 4.7
parent 3a319f5cf4
commit ce1c3822a2
2 changed files with 11 additions and 0 deletions
@@ -0,0 +1 @@
DROP TABLE solar;
@@ -0,0 +1,10 @@
CREATE TABLE solar (
period_start TIMESTAMPTZ PRIMARY KEY,
pv_yield_kwh DOUBLE PRECISION NOT NULL,
inverter_yield_kwh DOUBLE PRECISION NOT NULL,
export_kwh DOUBLE PRECISION NOT NULL,
import_kwh DOUBLE PRECISION NOT NULL,
charge_kwh DOUBLE PRECISION NOT NULL,
discharge_kwh DOUBLE PRECISION NOT NULL,
revenue_eur DOUBLE PRECISION NOT NULL
);