-
Notifications
You must be signed in to change notification settings - Fork 6
/
init.sql
54 lines (48 loc) · 2.05 KB
/
init.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
CREATE DATABASE kostal;
-- Table: public.pvwr
-- DROP TABLE public.pvwr;
CREATE TABLE public.pvwr
(
id bigint NOT NULL DEFAULT nextval('pvwr_id_seq'::regclass),
"timestamp" timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
pv_generator_dc_input_1_voltage numeric NOT NULL,
pv_generator_dc_input_1_current numeric NOT NULL,
pv_generator_dc_input_1_power numeric NOT NULL,
house_home_consumption_covered_by_solar_generator numeric NOT NULL,
house_home_consumption_covered_by_grid numeric NOT NULL,
house_phase_selective_home_consumption_phase_1 numeric NOT NULL,
house_phase_selective_home_consumption_phase_2 numeric NOT NULL,
house_phase_selective_home_consumption_phase_3 numeric NOT NULL,
grid_grid_parameters_output_power numeric NOT NULL,
grid_grid_parameters_grid_frequency numeric NOT NULL,
grid_grid_parameters_cos numeric NOT NULL,
grid_phase_1_voltage numeric NOT NULL,
grid_phase_1_current numeric NOT NULL,
grid_phase_1_power numeric NOT NULL,
grid_phase_2_voltage numeric NOT NULL,
grid_phase_2_current numeric NOT NULL,
grid_phase_2_power numeric NOT NULL,
grid_phase_3_voltage numeric NOT NULL,
grid_phase_3_current numeric NOT NULL,
grid_phase_3_power numeric NOT NULL,
stats_total_yield numeric NOT NULL,
stats_total_operation_time numeric NOT NULL,
stats_total_total_home_consumption numeric NOT NULL,
stats_total_self_consumption_kwh numeric NOT NULL,
stats_total_self_consumption_rate numeric NOT NULL,
stats_total_degree_of_self_sufficiency numeric NOT NULL,
stats_day_yield numeric NOT NULL,
stats_day_total_home_consumption numeric NOT NULL,
stats_day_self_consumption_kwh numeric NOT NULL,
stats_day_self_consumption_rate numeric NOT NULL,
stats_day_degree_of_self_sufficiency numeric NOT NULL,
CONSTRAINT pvwr_pkey PRIMARY KEY (id)
)
WITH (
OIDS = FALSE
)
TABLESPACE pg_default;
ALTER TABLE public.pvwr
OWNER to postgres;
GRANT SELECT ON TABLE public.pvwr TO grafanareader;
GRANT ALL ON TABLE public.pvwr TO postgres;