This commit is contained in:
2025-01-24 13:19:20 +01:00
parent 1387a2230c
commit ec6fc95b91
3 changed files with 78 additions and 0 deletions

14
queries/create.sql Normal file
View File

@ -0,0 +1,14 @@
CREATE TABLE pv_energy_by_month (
id serial NOT NULL PRIMARY KEY,
month integer NOT NULL,
year integer NOT NULL,
created_at timestamp NOT NULL DEFAULT now(),
last_changed timestamp,
update_counter integer NOT NULL DEFAULT 0,
baseline_energy real NOT NULL,
current_energy real NOT NULL DEFAULT 0.0,
CONSTRAINT pv_energy_by_month__month_year_unique UNIQUE(month, year)
);