-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
STU-25778: Add aggregation and processing_type tables
- Loading branch information
Showing
7 changed files
with
350 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Aggregation contains information about any aggregations done to the parameter over some time period. | ||
|
||
For example maximum of a temperature, or accumulation of precipitation. | ||
|
||
| column | data type | NOT NULL | description | foreign key | | ||
|---|---|---|---|---| | ||
| id | integer (serial) | X | auto-generated primary key | | | ||
| name | varchar(50) | | aggregation name | | | ||
| description | text | | description of the aggregation | | | ||
| last_updater | text | | username of the last modifier | | | ||
| last_updated | timestamptz | | time of last modification | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Processing_type contains information about any statistical processing done to the parameter. | ||
|
||
For example a probability or a fractile. | ||
|
||
| column | data type | NOT NULL | description | foreign key | | ||
|---|---|---|---|---| | ||
| id | integer (serial) | X | auto-generated primary key | | | ||
| name | varchar(50) | | processing type name | | | ||
| description | text | | description of the processing type | | | ||
| last_updater | text | | username of the last modifier | | | ||
| last_updated | timestamptz | | time of last modification | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
-- | ||
-- PostgreSQL database dump | ||
-- | ||
|
||
SET statement_timeout = 0; | ||
SET lock_timeout = 0; | ||
SET client_encoding = 'UTF8'; | ||
SET standard_conforming_strings = on; | ||
SET check_function_bodies = false; | ||
SET client_min_messages = warning; | ||
|
||
SET search_path = public, pg_catalog; | ||
|
||
-- | ||
-- Data for Name: aggregation; Type: TABLE DATA; Schema: public; Owner: wetodb | ||
-- | ||
|
||
COPY aggregation (id, name, description, last_updater, last_updated) FROM stdin; | ||
1 INSTANT No aggregation \N \N | ||
2 MEAN Mean over time period \N \N | ||
3 ACCUMULATION Accumulation over time period \N \N | ||
4 MAX Maximum over time period \N \N | ||
5 MIN Minimum over time period \N \N | ||
6 RANGE Range (maximum minus minimum) over time period \N \N | ||
7 MEDIAN Median value over time period \N \N | ||
8 VAR Variance over time period \N \N | ||
9 STDE Standard deviation over time period \N \N | ||
10 MODE Most common value over time period \N \N | ||
11 INTENSITY Peak intensity over time period \N \N | ||
12 DOMINANCE Dominant or prevailing value over time period \N \N | ||
\. | ||
|
||
SELECT pg_catalog.setval('aggregation_id_seq', 12, true); | ||
|
||
-- | ||
-- PostgreSQL database dump complete | ||
-- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
-- | ||
-- PostgreSQL database dump | ||
-- | ||
|
||
SET statement_timeout = 0; | ||
SET lock_timeout = 0; | ||
SET client_encoding = 'UTF8'; | ||
SET standard_conforming_strings = on; | ||
SET check_function_bodies = false; | ||
SET client_min_messages = warning; | ||
|
||
SET search_path = public, pg_catalog; | ||
|
||
SET default_tablespace = ''; | ||
|
||
SET default_with_oids = false; | ||
|
||
-- | ||
-- Name: aggregation; Type: TABLE; Schema: public; Owner: wetodb; Tablespace: | ||
-- | ||
|
||
CREATE TABLE aggregation ( | ||
id integer NOT NULL, | ||
name character varying(50) NOT NULL, | ||
description text NOT NULL, | ||
last_updater text, | ||
last_updated timestamp(0) without time zone | ||
); | ||
|
||
|
||
ALTER TABLE public.aggregation OWNER TO radon_admin; | ||
|
||
-- | ||
-- Name: COLUMN aggregation.last_updater; Type: COMMENT; Schema: public; Owner: wetodb | ||
-- | ||
|
||
COMMENT ON COLUMN aggregation.last_updater IS 'Fixed column for last updater'; | ||
|
||
|
||
-- | ||
-- Name: COLUMN aggregation.last_updated; Type: COMMENT; Schema: public; Owner: wetodb | ||
-- | ||
|
||
COMMENT ON COLUMN aggregation.last_updated IS 'Fixed column for last updating time'; | ||
|
||
|
||
-- | ||
-- Name: aggregation_id_seq; Type: SEQUENCE; Schema: public; Owner: wetodb | ||
-- | ||
|
||
CREATE SEQUENCE aggregation_id_seq | ||
START WITH 1 | ||
INCREMENT BY 1 | ||
NO MINVALUE | ||
NO MAXVALUE | ||
CACHE 1; | ||
|
||
|
||
ALTER TABLE public.aggregation_id_seq OWNER TO radon_admin; | ||
|
||
-- | ||
-- Name: aggregation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: wetodb | ||
-- | ||
|
||
ALTER SEQUENCE aggregation_id_seq OWNED BY aggregation.id; | ||
|
||
|
||
-- | ||
-- Name: id; Type: DEFAULT; Schema: public; Owner: wetodb | ||
-- | ||
|
||
ALTER TABLE ONLY aggregation ALTER COLUMN id SET DEFAULT nextval('aggregation_id_seq'::regclass); | ||
|
||
|
||
-- | ||
-- Name: aggregation_name_version_idx; Type: CONSTRAINT; Schema: public; Owner: wetodb; Tablespace: | ||
-- | ||
|
||
ALTER TABLE ONLY aggregation | ||
ADD CONSTRAINT aggregation_name_idx UNIQUE (name); | ||
|
||
|
||
-- | ||
-- Name: aggregation_pkey; Type: CONSTRAINT; Schema: public; Owner: wetodb; Tablespace: | ||
-- | ||
|
||
ALTER TABLE ONLY aggregation | ||
ADD CONSTRAINT aggregation_pkey PRIMARY KEY (id); | ||
|
||
|
||
-- | ||
-- Name: audit_trigger_row; Type: TRIGGER; Schema: public; Owner: wetodb | ||
-- | ||
|
||
CREATE TRIGGER audit_trigger_row AFTER UPDATE ON aggregation FOR EACH ROW EXECUTE PROCEDURE audit.if_modified_func('true'); | ||
|
||
|
||
-- | ||
-- Name: aggregation_store_last_updated_trg; Type: TRIGGER; Schema: public; Owner: wetodb | ||
-- | ||
|
||
CREATE TRIGGER aggregation_store_last_updated_trg BEFORE UPDATE ON aggregation FOR EACH ROW EXECUTE PROCEDURE store_last_updated_f(); | ||
|
||
|
||
-- | ||
-- Name: aggregation; Type: ACL; Schema: public; Owner: wetodb | ||
-- | ||
|
||
REVOKE ALL ON TABLE aggregation FROM PUBLIC; | ||
REVOKE ALL ON TABLE aggregation FROM wetodb; | ||
GRANT ALL ON TABLE aggregation TO wetodb; | ||
GRANT SELECT ON TABLE aggregation TO radon_ro; | ||
GRANT INSERT,DELETE,UPDATE ON TABLE aggregation TO radon_rw; | ||
|
||
|
||
-- | ||
-- PostgreSQL database dump complete | ||
-- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
-- | ||
-- PostgreSQL database dump | ||
-- | ||
|
||
SET statement_timeout = 0; | ||
SET lock_timeout = 0; | ||
SET client_encoding = 'UTF8'; | ||
SET standard_conforming_strings = on; | ||
SET check_function_bodies = false; | ||
SET client_min_messages = warning; | ||
|
||
SET search_path = public, pg_catalog; | ||
|
||
-- | ||
-- Data for Name: processing_type; Type: TABLE DATA; Schema: public; Owner: wetodb | ||
-- | ||
|
||
COPY processing_type (id, name, description, last_updater, last_updated) FROM stdin; | ||
1 UNPROCESSED No processing \N \N | ||
2 PROBGE Probability greater than or equal \N \N | ||
3 PROBGT Probability greater than \N \N | ||
4 PROBLE Probability less than or equal \N \N | ||
5 PROBLT Probability less than \N \N | ||
6 PROBEQ Probability equal to \N \N | ||
7 PROBIN Probability equal to list of values \N \N | ||
8 FRACTILE Fractile \N \N | ||
9 PROBGE_AREA Probability greater than or equal, using an area aggregation \N \N | ||
10 PROBGT_AREA Probability greater than, using an area aggregation \N \N | ||
11 PROBLE_AREA Probability less than or equal, using an area aggregation \N \N | ||
12 PROBLT_AREA Probability less than, using an area aggregation \N \N | ||
13 PROBEQ_AREA Probability equal to, using an area aggregation \N \N | ||
14 PROBIN_AREA Probability in list of values, using an area aggregation \N \N | ||
15 BIAS_CORR Bias correction \N \N | ||
16 MEAN Mean value \N \N | ||
17 STDE Standard deviation \N \N | ||
18 FILTERED Smoothing or filtering \N \N | ||
19 DETREND Trends (long-term climate effects) removed \N \N | ||
20 ANOMALY Anomaly \N \N | ||
21 NORMALIZED Normalized to specific range or relative to mean/stde \N \N | ||
22 CLIMATOLOGY Climate normal or climatology \N \N | ||
23 CATEGORIZED Categorization of continuous variables \N \N | ||
24 PERCENT_CHANGE Percentage change relative to baseline \N \N | ||
\. | ||
|
||
SELECT pg_catalog.setval('processing_type_id_seq', 24, true); | ||
|
||
-- | ||
-- PostgreSQL database dump complete | ||
-- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
-- | ||
-- PostgreSQL database dump | ||
-- | ||
|
||
SET statement_timeout = 0; | ||
SET lock_timeout = 0; | ||
SET client_encoding = 'UTF8'; | ||
SET standard_conforming_strings = on; | ||
SET check_function_bodies = false; | ||
SET client_min_messages = warning; | ||
|
||
SET search_path = public, pg_catalog; | ||
|
||
SET default_tablespace = ''; | ||
|
||
SET default_with_oids = false; | ||
|
||
-- | ||
-- Name: processing_type; Type: TABLE; Schema: public; Owner: wetodb; Tablespace: | ||
-- | ||
|
||
CREATE TABLE processing_type ( | ||
id integer NOT NULL, | ||
name character varying(50) NOT NULL, | ||
description text NOT NULL, | ||
last_updater text, | ||
last_updated timestamp(0) without time zone | ||
); | ||
|
||
|
||
ALTER TABLE public.processing_type OWNER TO radon_admin; | ||
|
||
-- | ||
-- Name: COLUMN processing_type.last_updater; Type: COMMENT; Schema: public; Owner: wetodb | ||
-- | ||
|
||
COMMENT ON COLUMN processing_type.last_updater IS 'Fixed column for last updater'; | ||
|
||
|
||
-- | ||
-- Name: COLUMN processing_type.last_updated; Type: COMMENT; Schema: public; Owner: wetodb | ||
-- | ||
|
||
COMMENT ON COLUMN processing_type.last_updated IS 'Fixed column for last updating time'; | ||
|
||
|
||
-- | ||
-- Name: processing_type_id_seq; Type: SEQUENCE; Schema: public; Owner: wetodb | ||
-- | ||
|
||
CREATE SEQUENCE processing_type_id_seq | ||
START WITH 1 | ||
INCREMENT BY 1 | ||
NO MINVALUE | ||
NO MAXVALUE | ||
CACHE 1; | ||
|
||
|
||
ALTER TABLE public.processing_type_id_seq OWNER TO radon_admin; | ||
|
||
-- | ||
-- Name: processing_type_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: wetodb | ||
-- | ||
|
||
ALTER SEQUENCE processing_type_id_seq OWNED BY processing_type.id; | ||
|
||
|
||
-- | ||
-- Name: id; Type: DEFAULT; Schema: public; Owner: wetodb | ||
-- | ||
|
||
ALTER TABLE ONLY processing_type ALTER COLUMN id SET DEFAULT nextval('processing_type_id_seq'::regclass); | ||
|
||
|
||
-- | ||
-- Name: processing_type_name_version_idx; Type: CONSTRAINT; Schema: public; Owner: wetodb; Tablespace: | ||
-- | ||
|
||
ALTER TABLE ONLY processing_type | ||
ADD CONSTRAINT processing_type_name_idx UNIQUE (name); | ||
|
||
|
||
-- | ||
-- Name: processing_type_pkey; Type: CONSTRAINT; Schema: public; Owner: wetodb; Tablespace: | ||
-- | ||
|
||
ALTER TABLE ONLY processing_type | ||
ADD CONSTRAINT processing_type_pkey PRIMARY KEY (id); | ||
|
||
|
||
-- | ||
-- Name: audit_trigger_row; Type: TRIGGER; Schema: public; Owner: wetodb | ||
-- | ||
|
||
CREATE TRIGGER audit_trigger_row AFTER UPDATE ON processing_type FOR EACH ROW EXECUTE PROCEDURE audit.if_modified_func('true'); | ||
|
||
|
||
-- | ||
-- Name: processing_type_store_last_updated_trg; Type: TRIGGER; Schema: public; Owner: wetodb | ||
-- | ||
|
||
CREATE TRIGGER processing_type_store_last_updated_trg BEFORE UPDATE ON processing_type FOR EACH ROW EXECUTE PROCEDURE store_last_updated_f(); | ||
|
||
|
||
-- | ||
-- Name: processing_type; Type: ACL; Schema: public; Owner: wetodb | ||
-- | ||
|
||
REVOKE ALL ON TABLE processing_type FROM PUBLIC; | ||
REVOKE ALL ON TABLE processing_type FROM wetodb; | ||
GRANT ALL ON TABLE processing_type TO wetodb; | ||
GRANT SELECT ON TABLE processing_type TO radon_ro; | ||
GRANT INSERT,DELETE,UPDATE ON TABLE processing_type TO radon_rw; | ||
|
||
|
||
-- | ||
-- PostgreSQL database dump complete | ||
-- | ||
|