stats B11: EP-Online energy labels (monthly total file → homes per label for NL, Gouda, Gouda PC4s; aggregates only), stats.ep_label_agg, monthly timer with key from ~/.config/stats/ep-online.env, charts on /stats/energy and /stats/gouda
Some checks failed
Deploy production / deploy (push) Has been cancelled
Some checks failed
Deploy production / deploy (push) Has been cancelled
This commit is contained in:
17
drizzle/20261025212601_stats_eponline/migration.sql
Normal file
17
drizzle/20261025212601_stats_eponline/migration.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
CREATE TABLE "stats"."ep_label_agg" (
|
||||
"snapshot" date,
|
||||
"area" text,
|
||||
"label" text,
|
||||
"homes" integer NOT NULL,
|
||||
CONSTRAINT "ep_label_agg_pkey" PRIMARY KEY("snapshot","area","label")
|
||||
);
|
||||
--> statement-breakpoint
|
||||
DO $$
|
||||
BEGIN
|
||||
IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'personal_app') THEN
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA stats TO personal_app;
|
||||
END IF;
|
||||
IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'personal_ro') THEN
|
||||
GRANT SELECT ON ALL TABLES IN SCHEMA stats TO personal_ro;
|
||||
END IF;
|
||||
END $$;
|
||||
Reference in New Issue
Block a user