diff options
author | Dennis Eriksen <d@ennis.no> | 2022-09-14 12:35:43 +0200 |
---|---|---|
committer | Dennis Eriksen <d@ennis.no> | 2022-09-14 12:35:43 +0200 |
commit | e58dc713bef769c55efb42a76b6e058c28122bf4 (patch) | |
tree | 9f8bf9710cdfba33dd8b04eff630e15610c40a8d /schema.sql | |
parent | Sometimes there's a delay before new data is available. Increase the (diff) | |
download | energyscripts-e58dc713bef769c55efb42a76b6e058c28122bf4.tar.gz |
Adding Entsoe as a data source. Also adding Norges Bank, since Entsoes
prices are in Euros, and I need an exchange-rate.
Diffstat (limited to 'schema.sql')
-rw-r--r-- | schema.sql | 47 |
1 files changed, 47 insertions, 0 deletions
@@ -38,6 +38,37 @@ CREATE TABLE public.elvia ( ALTER TABLE public.elvia OWNER TO dennis; -- +-- Name: entsoe; Type: TABLE; Schema: public; Owner: dennis +-- + +CREATE TABLE public.entsoe ( + starttime timestamp with time zone NOT NULL, + zone character varying(4) NOT NULL, + price numeric NOT NULL, + currency character varying(4) DEFAULT 'EUR'::character varying NOT NULL, + unitmeasure character varying(4) DEFAULT 'MWH'::character varying NOT NULL, + inserted timestamp with time zone DEFAULT now() NOT NULL +); + + +ALTER TABLE public.entsoe OWNER TO dennis; + +-- +-- Name: nbex; Type: TABLE; Schema: public; Owner: dennis +-- + +CREATE TABLE public.nbex ( + startdate date NOT NULL, + base_cur character varying(3) DEFAULT 'EUR'::character varying NOT NULL, + quote_cur character varying(3) DEFAULT 'NOK'::character varying NOT NULL, + rate numeric NOT NULL, + inserted timestamp with time zone DEFAULT now() NOT NULL +); + + +ALTER TABLE public.nbex OWNER TO dennis; + +-- -- Name: tibber_consumption; Type: TABLE; Schema: public; Owner: dennis -- @@ -99,6 +130,22 @@ ALTER TABLE ONLY public.elvia -- +-- Name: entsoe entsoe_pkey; Type: CONSTRAINT; Schema: public; Owner: dennis +-- + +ALTER TABLE ONLY public.entsoe + ADD CONSTRAINT entsoe_pkey PRIMARY KEY (starttime, zone); + + +-- +-- Name: nbex nbexchange_pkey; Type: CONSTRAINT; Schema: public; Owner: dennis +-- + +ALTER TABLE ONLY public.nbex + ADD CONSTRAINT nbexchange_pkey PRIMARY KEY (startdate, base_cur, quote_cur); + + +-- -- Name: tibber_consumption tibber_consumption_pkey; Type: CONSTRAINT; Schema: public; Owner: dennis -- |