| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849 |
- --
- -- PostgreSQL database dump
- --
- -- Dumped from database version 11.12
- -- Dumped by pg_dump version 15.2
- -- Started on 2023-05-05 01:10:04
- SET statement_timeout = 0;
- SET lock_timeout = 0;
- SET idle_in_transaction_session_timeout = 0;
- SET client_encoding = 'UTF8';
- SET standard_conforming_strings = on;
- SELECT pg_catalog.set_config('search_path', '', false);
- SET check_function_bodies = false;
- SET xmloption = content;
- SET client_min_messages = warning;
- SET row_security = off;
- CREATE ROLE senslog NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT;
- CREATE ROLE maplog_app NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN PASSWORD 'MAPlog';
- GRANT senslog TO maplog_app;
- --
- -- TOC entry 3861 (class 1262 OID 54507)
- -- Name: maplog; Type: DATABASE; Schema: -; Owner: postgres
- --
- CREATE DATABASE maplog WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE_PROVIDER = libc LOCALE = 'en_US.UTF-8';
- ALTER DATABASE maplog OWNER TO senslog;
- \connect maplog
- SET statement_timeout = 0;
- SET lock_timeout = 0;
- SET idle_in_transaction_session_timeout = 0;
- SET client_encoding = 'UTF8';
- SET standard_conforming_strings = on;
- SELECT pg_catalog.set_config('search_path', '', false);
- SET check_function_bodies = false;
- SET xmloption = content;
- SET client_min_messages = warning;
- SET row_security = off;
- --
- -- TOC entry 9 (class 2615 OID 55528)
- -- Name: maplog; Type: SCHEMA; Schema: -; Owner: postgres
- --
- CREATE SCHEMA maplog;
- ALTER SCHEMA maplog OWNER TO senslog;
- --
- -- TOC entry 7 (class 2615 OID 2200)
- -- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
- --
- -- *not* creating schema, since initdb creates it
- ALTER SCHEMA public OWNER TO senslog;
- --
- -- TOC entry 2 (class 3079 OID 54508)
- -- Name: postgis; Type: EXTENSION; Schema: -; Owner: -
- --
- CREATE EXTENSION IF NOT EXISTS postgis WITH SCHEMA public;
- --
- -- TOC entry 3863 (class 0 OID 0)
- -- Dependencies: 2
- -- Name: EXTENSION postgis; Type: COMMENT; Schema: -; Owner:
- --
- COMMENT ON EXTENSION postgis IS 'PostGIS geometry and geography spatial types and functions';
- SET default_tablespace = '';
- --
- -- TOC entry 216 (class 1259 OID 62701)
- -- Name: campaign; Type: TABLE; Schema: maplog; Owner: postgres
- --
- CREATE TABLE maplog.campaign (
- campaign_id integer NOT NULL,
- description text NOT NULL,
- from_time timestamp with time zone NOT NULL,
- to_time timestamp with time zone NOT NULL
- );
- ALTER TABLE maplog.campaign OWNER TO senslog;
- --
- -- TOC entry 215 (class 1259 OID 62699)
- -- Name: campaign_campaign_id_seq; Type: SEQUENCE; Schema: maplog; Owner: postgres
- --
- CREATE SEQUENCE maplog.campaign_campaign_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- ALTER TABLE maplog.campaign_campaign_id_seq OWNER TO senslog;
- --
- -- TOC entry 3864 (class 0 OID 0)
- -- Dependencies: 215
- -- Name: campaign_campaign_id_seq; Type: SEQUENCE OWNED BY; Schema: maplog; Owner: postgres
- --
- ALTER SEQUENCE maplog.campaign_campaign_id_seq OWNED BY maplog.campaign.campaign_id;
- --
- -- TOC entry 224 (class 1259 OID 62784)
- -- Name: groups; Type: TABLE; Schema: maplog; Owner: postgres
- --
- CREATE TABLE maplog.groups (
- group_id integer NOT NULL,
- group_name text,
- parent_group_id integer,
- has_children boolean DEFAULT false
- );
- ALTER TABLE maplog.groups OWNER TO senslog;
- --
- -- TOC entry 223 (class 1259 OID 62782)
- -- Name: group_group_id_seq; Type: SEQUENCE; Schema: maplog; Owner: postgres
- --
- CREATE SEQUENCE maplog.group_group_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- ALTER TABLE maplog.group_group_id_seq OWNER TO senslog;
- --
- -- TOC entry 3865 (class 0 OID 0)
- -- Dependencies: 223
- -- Name: group_group_id_seq; Type: SEQUENCE OWNED BY; Schema: maplog; Owner: postgres
- --
- ALTER SEQUENCE maplog.group_group_id_seq OWNED BY maplog.groups.group_id;
- --
- -- TOC entry 212 (class 1259 OID 55614)
- -- Name: obs_telemetry; Type: TABLE; Schema: maplog; Owner: postgres
- --
- CREATE TABLE maplog.obs_telemetry (
- obs_id bigint NOT NULL,
- time_stamp timestamp with time zone NOT NULL,
- unit_id bigint NOT NULL,
- observed_values jsonb NOT NULL,
- the_geom public.geometry(Point,4326),
- time_received timestamp with time zone DEFAULT now() NOT NULL
- );
- ALTER TABLE maplog.obs_telemetry OWNER TO senslog;
- --
- -- TOC entry 211 (class 1259 OID 55612)
- -- Name: obs_telemetry_obs_id_seq; Type: SEQUENCE; Schema: maplog; Owner: postgres
- --
- CREATE SEQUENCE maplog.obs_telemetry_obs_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- ALTER TABLE maplog.obs_telemetry_obs_id_seq OWNER TO senslog;
- --
- -- TOC entry 3866 (class 0 OID 0)
- -- Dependencies: 211
- -- Name: obs_telemetry_obs_id_seq; Type: SEQUENCE OWNED BY; Schema: maplog; Owner: postgres
- --
- ALTER SEQUENCE maplog.obs_telemetry_obs_id_seq OWNED BY maplog.obs_telemetry.obs_id;
- --
- -- TOC entry 209 (class 1259 OID 55579)
- -- Name: phenomenon; Type: TABLE; Schema: maplog; Owner: postgres
- --
- CREATE TABLE maplog.phenomenon (
- phenomenon_id integer NOT NULL,
- phenomenon_name text NOT NULL,
- uom character varying(30) NOT NULL,
- uom_link text
- );
- ALTER TABLE maplog.phenomenon OWNER TO senslog;
- --
- -- TOC entry 208 (class 1259 OID 55577)
- -- Name: phenomenon_phenomenon_id_seq; Type: SEQUENCE; Schema: maplog; Owner: postgres
- --
- CREATE SEQUENCE maplog.phenomenon_phenomenon_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- ALTER TABLE maplog.phenomenon_phenomenon_id_seq OWNER TO senslog;
- --
- -- TOC entry 3867 (class 0 OID 0)
- -- Dependencies: 208
- -- Name: phenomenon_phenomenon_id_seq; Type: SEQUENCE OWNED BY; Schema: maplog; Owner: postgres
- --
- ALTER SEQUENCE maplog.phenomenon_phenomenon_id_seq OWNED BY maplog.phenomenon.phenomenon_id;
- --
- -- TOC entry 207 (class 1259 OID 55566)
- -- Name: sensor; Type: TABLE; Schema: maplog; Owner: postgres
- --
- CREATE TABLE maplog.sensor (
- sensor_id bigint NOT NULL,
- sensor_name character varying(100),
- sensor_type text,
- sensor_type_id integer,
- min_range text,
- max_range text,
- phenomenon_id integer NOT NULL
- );
- ALTER TABLE maplog.sensor OWNER TO senslog;
- --
- -- TOC entry 206 (class 1259 OID 55564)
- -- Name: sensor_sensor_id_seq; Type: SEQUENCE; Schema: maplog; Owner: postgres
- --
- CREATE SEQUENCE maplog.sensor_sensor_id_seq
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- ALTER TABLE maplog.sensor_sensor_id_seq OWNER TO senslog;
- --
- -- TOC entry 3868 (class 0 OID 0)
- -- Dependencies: 206
- -- Name: sensor_sensor_id_seq; Type: SEQUENCE OWNED BY; Schema: maplog; Owner: postgres
- --
- ALTER SEQUENCE maplog.sensor_sensor_id_seq OWNED BY maplog.sensor.sensor_id;
- --
- -- TOC entry 213 (class 1259 OID 55644)
- -- Name: system_user; Type: TABLE; Schema: maplog; Owner: postgres
- --
- CREATE TABLE maplog.system_user (
- user_id integer NOT NULL,
- user_name text NOT NULL,
- user_real_name text,
- user_password text,
- group_id integer,
- rights_id integer DEFAULT 0
- );
- ALTER TABLE maplog.system_user OWNER TO senslog;
- --
- -- TOC entry 204 (class 1259 OID 55540)
- -- Name: unit; Type: TABLE; Schema: maplog; Owner: postgres
- --
- CREATE TABLE maplog.unit (
- unit_id bigint NOT NULL,
- description text,
- is_mobile boolean DEFAULT true NOT NULL,
- unit_type_id character varying(2) DEFAULT 'X'::character varying NOT NULL
- );
- ALTER TABLE maplog.unit OWNER TO senslog;
- --
- -- TOC entry 218 (class 1259 OID 62712)
- -- Name: unit_to_campaign; Type: TABLE; Schema: maplog; Owner: postgres
- --
- CREATE TABLE maplog.unit_to_campaign (
- id integer NOT NULL,
- camp_id integer NOT NULL,
- unit_id bigint NOT NULL,
- from_time timestamp with time zone NOT NULL,
- to_time timestamp with time zone NOT NULL
- );
- ALTER TABLE maplog.unit_to_campaign OWNER TO senslog;
- --
- -- TOC entry 217 (class 1259 OID 62710)
- -- Name: unit_to_campaign_id_seq; Type: SEQUENCE; Schema: maplog; Owner: postgres
- --
- CREATE SEQUENCE maplog.unit_to_campaign_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- ALTER TABLE maplog.unit_to_campaign_id_seq OWNER TO senslog;
- --
- -- TOC entry 3869 (class 0 OID 0)
- -- Dependencies: 217
- -- Name: unit_to_campaign_id_seq; Type: SEQUENCE OWNED BY; Schema: maplog; Owner: postgres
- --
- ALTER SEQUENCE maplog.unit_to_campaign_id_seq OWNED BY maplog.unit_to_campaign.id;
- --
- -- TOC entry 226 (class 1259 OID 62796)
- -- Name: unit_to_group; Type: TABLE; Schema: maplog; Owner: postgres
- --
- CREATE TABLE maplog.unit_to_group (
- id integer NOT NULL,
- group_id integer,
- unit_id bigint
- );
- ALTER TABLE maplog.unit_to_group OWNER TO senslog;
- --
- -- TOC entry 225 (class 1259 OID 62794)
- -- Name: unit_to_group_id_seq; Type: SEQUENCE; Schema: maplog; Owner: postgres
- --
- CREATE SEQUENCE maplog.unit_to_group_id_seq
- AS integer
- START WITH 1
- INCREMENT BY 1
- NO MINVALUE
- NO MAXVALUE
- CACHE 1;
- ALTER TABLE maplog.unit_to_group_id_seq OWNER TO senslog;
- --
- -- TOC entry 3870 (class 0 OID 0)
- -- Dependencies: 225
- -- Name: unit_to_group_id_seq; Type: SEQUENCE OWNED BY; Schema: maplog; Owner: postgres
- --
- ALTER SEQUENCE maplog.unit_to_group_id_seq OWNED BY maplog.unit_to_group.id;
- --
- -- TOC entry 210 (class 1259 OID 55594)
- -- Name: unit_to_sensor; Type: TABLE; Schema: maplog; Owner: postgres
- --
- CREATE TABLE maplog.unit_to_sensor (
- sensor_id bigint NOT NULL,
- unit_id bigint NOT NULL,
- first_obs_ts timestamp with time zone,
- last_obs_ts timestamp with time zone,
- last_obs_value double precision DEFAULT 'NaN'::double precision
- );
- ALTER TABLE maplog.unit_to_sensor OWNER TO senslog;
- --
- -- TOC entry 205 (class 1259 OID 55548)
- -- Name: unit_type; Type: TABLE; Schema: maplog; Owner: postgres
- --
- CREATE TABLE maplog.unit_type (
- unit_type_id character varying(2) NOT NULL,
- type_name character varying(20) NOT NULL,
- description text
- );
- ALTER TABLE maplog.unit_type OWNER TO senslog;
- --
- -- TOC entry 214 (class 1259 OID 55654)
- -- Name: user_to_campaign; Type: TABLE; Schema: maplog; Owner: postgres
- --
- CREATE TABLE maplog.user_to_campaign (
- user_id integer NOT NULL,
- campaign_id integer NOT NULL
- );
- ALTER TABLE maplog.user_to_campaign OWNER TO senslog;
- --
- -- TOC entry 3638 (class 2604 OID 62704)
- -- Name: campaign campaign_id; Type: DEFAULT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.campaign ALTER COLUMN campaign_id SET DEFAULT nextval('maplog.campaign_campaign_id_seq'::regclass);
- --
- -- TOC entry 3643 (class 2604 OID 62787)
- -- Name: groups group_id; Type: DEFAULT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.groups ALTER COLUMN group_id SET DEFAULT nextval('maplog.group_group_id_seq'::regclass);
- --
- -- TOC entry 3635 (class 2604 OID 55617)
- -- Name: obs_telemetry obs_id; Type: DEFAULT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.obs_telemetry ALTER COLUMN obs_id SET DEFAULT nextval('maplog.obs_telemetry_obs_id_seq'::regclass);
- --
- -- TOC entry 3633 (class 2604 OID 55582)
- -- Name: phenomenon phenomenon_id; Type: DEFAULT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.phenomenon ALTER COLUMN phenomenon_id SET DEFAULT nextval('maplog.phenomenon_phenomenon_id_seq'::regclass);
- --
- -- TOC entry 3632 (class 2604 OID 55569)
- -- Name: sensor sensor_id; Type: DEFAULT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.sensor ALTER COLUMN sensor_id SET DEFAULT nextval('maplog.sensor_sensor_id_seq'::regclass);
- --
- -- TOC entry 3639 (class 2604 OID 62715)
- -- Name: unit_to_campaign id; Type: DEFAULT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.unit_to_campaign ALTER COLUMN id SET DEFAULT nextval('maplog.unit_to_campaign_id_seq'::regclass);
- --
- -- TOC entry 3645 (class 2604 OID 62799)
- -- Name: unit_to_group id; Type: DEFAULT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.unit_to_group ALTER COLUMN id SET DEFAULT nextval('maplog.unit_to_group_id_seq'::regclass);
- --
- -- TOC entry 3677 (class 2606 OID 62709)
- -- Name: campaign campaign_pkey; Type: CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.campaign
- ADD CONSTRAINT campaign_pkey PRIMARY KEY (campaign_id);
- --
- -- TOC entry 3689 (class 2606 OID 62793)
- -- Name: groups group_pkey; Type: CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.groups
- ADD CONSTRAINT group_pkey PRIMARY KEY (group_id);
- --
- -- TOC entry 3667 (class 2606 OID 55623)
- -- Name: obs_telemetry obs_telemetry_pkey; Type: CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.obs_telemetry
- ADD CONSTRAINT obs_telemetry_pkey PRIMARY KEY (obs_id);
- --
- -- TOC entry 3660 (class 2606 OID 55587)
- -- Name: phenomenon phenomenon_pkey; Type: CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.phenomenon
- ADD CONSTRAINT phenomenon_pkey PRIMARY KEY (phenomenon_id);
- --
- -- TOC entry 3656 (class 2606 OID 55574)
- -- Name: sensor sensor_pkey; Type: CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.sensor
- ADD CONSTRAINT sensor_pkey PRIMARY KEY (sensor_id);
- --
- -- TOC entry 3658 (class 2606 OID 55576)
- -- Name: sensor sensor_sensor_name_key; Type: CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.sensor
- ADD CONSTRAINT sensor_sensor_name_key UNIQUE (sensor_name);
- --
- -- TOC entry 3670 (class 2606 OID 55653)
- -- Name: system_user systemuser_pk; Type: CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.system_user
- ADD CONSTRAINT systemuser_pk PRIMARY KEY (user_id);
- --
- -- TOC entry 3651 (class 2606 OID 55557)
- -- Name: unit unit_pk; Type: CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.unit
- ADD CONSTRAINT unit_pk PRIMARY KEY (unit_id);
- --
- -- TOC entry 3681 (class 2606 OID 62717)
- -- Name: unit_to_campaign unit_to_campaign_pkey; Type: CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.unit_to_campaign
- ADD CONSTRAINT unit_to_campaign_pkey PRIMARY KEY (id);
- --
- -- TOC entry 3693 (class 2606 OID 62801)
- -- Name: unit_to_group unit_to_group_pkey; Type: CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.unit_to_group
- ADD CONSTRAINT unit_to_group_pkey PRIMARY KEY (id);
- --
- -- TOC entry 3653 (class 2606 OID 55555)
- -- Name: unit_type unittype_pk; Type: CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.unit_type
- ADD CONSTRAINT unittype_pk PRIMARY KEY (unit_type_id);
- --
- -- TOC entry 3675 (class 2606 OID 55658)
- -- Name: user_to_campaign user_to_campaign_pkey; Type: CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.user_to_campaign
- ADD CONSTRAINT user_to_campaign_pkey PRIMARY KEY (user_id, campaign_id);
- --
- -- TOC entry 3664 (class 2606 OID 55599)
- -- Name: unit_to_sensor uts_pk; Type: CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.unit_to_sensor
- ADD CONSTRAINT uts_pk PRIMARY KEY (unit_id, sensor_id);
- --
- -- TOC entry 3665 (class 1259 OID 55629)
- -- Name: fki_obss_unitid_fk; Type: INDEX; Schema: maplog; Owner: postgres
- --
- CREATE INDEX fki_obss_unitid_fk ON maplog.obs_telemetry USING btree (unit_id);
- --
- -- TOC entry 3654 (class 1259 OID 55593)
- -- Name: fki_sens_phenom_fk; Type: INDEX; Schema: maplog; Owner: postgres
- --
- CREATE INDEX fki_sens_phenom_fk ON maplog.sensor USING btree (phenomenon_id);
- --
- -- TOC entry 3671 (class 1259 OID 62723)
- -- Name: fki_u2c_campid; Type: INDEX; Schema: maplog; Owner: postgres
- --
- CREATE INDEX fki_u2c_campid ON maplog.user_to_campaign USING btree (campaign_id);
- --
- -- TOC entry 3672 (class 1259 OID 55670)
- -- Name: fki_u2c_campid_fk; Type: INDEX; Schema: maplog; Owner: postgres
- --
- CREATE INDEX fki_u2c_campid_fk ON maplog.user_to_campaign USING btree (campaign_id);
- --
- -- TOC entry 3673 (class 1259 OID 55664)
- -- Name: fki_u2c_userid_fk; Type: INDEX; Schema: maplog; Owner: postgres
- --
- CREATE INDEX fki_u2c_userid_fk ON maplog.user_to_campaign USING btree (user_id);
- --
- -- TOC entry 3678 (class 1259 OID 62735)
- -- Name: fki_un2c_campid; Type: INDEX; Schema: maplog; Owner: postgres
- --
- CREATE INDEX fki_un2c_campid ON maplog.unit_to_campaign USING btree (camp_id);
- --
- -- TOC entry 3679 (class 1259 OID 62729)
- -- Name: fki_un2c_unitid; Type: INDEX; Schema: maplog; Owner: postgres
- --
- CREATE INDEX fki_un2c_unitid ON maplog.unit_to_campaign USING btree (unit_id);
- --
- -- TOC entry 3690 (class 1259 OID 62813)
- -- Name: fki_unit2group_group_fk; Type: INDEX; Schema: maplog; Owner: postgres
- --
- CREATE INDEX fki_unit2group_group_fk ON maplog.unit_to_group USING btree (group_id);
- --
- -- TOC entry 3691 (class 1259 OID 62819)
- -- Name: fki_unit2group_unit_fk; Type: INDEX; Schema: maplog; Owner: postgres
- --
- CREATE INDEX fki_unit2group_unit_fk ON maplog.unit_to_group USING btree (unit_id);
- --
- -- TOC entry 3649 (class 1259 OID 55563)
- -- Name: fki_unit_unittype_fk; Type: INDEX; Schema: maplog; Owner: postgres
- --
- CREATE INDEX fki_unit_unittype_fk ON maplog.unit USING btree (unit_type_id);
- --
- -- TOC entry 3668 (class 1259 OID 62807)
- -- Name: fki_user2group_fk; Type: INDEX; Schema: maplog; Owner: postgres
- --
- CREATE INDEX fki_user2group_fk ON maplog.system_user USING btree (group_id);
- --
- -- TOC entry 3661 (class 1259 OID 55611)
- -- Name: fki_uts_sensorid_fk; Type: INDEX; Schema: maplog; Owner: postgres
- --
- CREATE INDEX fki_uts_sensorid_fk ON maplog.unit_to_sensor USING btree (sensor_id);
- --
- -- TOC entry 3662 (class 1259 OID 55605)
- -- Name: fki_uts_unitid_fk; Type: INDEX; Schema: maplog; Owner: postgres
- --
- CREATE INDEX fki_uts_unitid_fk ON maplog.unit_to_sensor USING btree (unit_id);
- --
- -- TOC entry 3700 (class 2606 OID 55624)
- -- Name: obs_telemetry obss_unitid_fk; Type: FK CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.obs_telemetry
- ADD CONSTRAINT obss_unitid_fk FOREIGN KEY (unit_id) REFERENCES maplog.unit(unit_id) ON UPDATE CASCADE ON DELETE CASCADE;
- --
- -- TOC entry 3697 (class 2606 OID 55588)
- -- Name: sensor sens_phenom_fk; Type: FK CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.sensor
- ADD CONSTRAINT sens_phenom_fk FOREIGN KEY (phenomenon_id) REFERENCES maplog.phenomenon(phenomenon_id);
- --
- -- TOC entry 3702 (class 2606 OID 62718)
- -- Name: user_to_campaign u2c_campid; Type: FK CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.user_to_campaign
- ADD CONSTRAINT u2c_campid FOREIGN KEY (campaign_id) REFERENCES maplog.campaign(campaign_id) ON UPDATE CASCADE ON DELETE CASCADE;
- --
- -- TOC entry 3703 (class 2606 OID 55659)
- -- Name: user_to_campaign u2c_userid_fk; Type: FK CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.user_to_campaign
- ADD CONSTRAINT u2c_userid_fk FOREIGN KEY (user_id) REFERENCES maplog.system_user(user_id) ON UPDATE CASCADE ON DELETE CASCADE;
- --
- -- TOC entry 3704 (class 2606 OID 62730)
- -- Name: unit_to_campaign un2c_campid; Type: FK CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.unit_to_campaign
- ADD CONSTRAINT un2c_campid FOREIGN KEY (camp_id) REFERENCES maplog.campaign(campaign_id) ON UPDATE CASCADE ON DELETE CASCADE;
- --
- -- TOC entry 3705 (class 2606 OID 62724)
- -- Name: unit_to_campaign un2c_unitid; Type: FK CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.unit_to_campaign
- ADD CONSTRAINT un2c_unitid FOREIGN KEY (unit_id) REFERENCES maplog.unit(unit_id) ON UPDATE CASCADE ON DELETE CASCADE;
- --
- -- TOC entry 3706 (class 2606 OID 62808)
- -- Name: unit_to_group unit2group_group_fk; Type: FK CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.unit_to_group
- ADD CONSTRAINT unit2group_group_fk FOREIGN KEY (group_id) REFERENCES maplog.groups(group_id) ON UPDATE CASCADE ON DELETE CASCADE;
- --
- -- TOC entry 3707 (class 2606 OID 62814)
- -- Name: unit_to_group unit2group_unit_fk; Type: FK CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.unit_to_group
- ADD CONSTRAINT unit2group_unit_fk FOREIGN KEY (unit_id) REFERENCES maplog.unit(unit_id) ON UPDATE CASCADE ON DELETE CASCADE;
- --
- -- TOC entry 3696 (class 2606 OID 55558)
- -- Name: unit unit_unittype_fk; Type: FK CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.unit
- ADD CONSTRAINT unit_unittype_fk FOREIGN KEY (unit_type_id) REFERENCES maplog.unit_type(unit_type_id);
- --
- -- TOC entry 3701 (class 2606 OID 62802)
- -- Name: system_user user2group_fk; Type: FK CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.system_user
- ADD CONSTRAINT user2group_fk FOREIGN KEY (group_id) REFERENCES maplog.groups(group_id) ON UPDATE CASCADE ON DELETE CASCADE;
- --
- -- TOC entry 3698 (class 2606 OID 55606)
- -- Name: unit_to_sensor uts_sensorid_fk; Type: FK CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.unit_to_sensor
- ADD CONSTRAINT uts_sensorid_fk FOREIGN KEY (sensor_id) REFERENCES maplog.sensor(sensor_id) ON UPDATE CASCADE ON DELETE CASCADE;
- --
- -- TOC entry 3699 (class 2606 OID 55600)
- -- Name: unit_to_sensor uts_unitid_fk; Type: FK CONSTRAINT; Schema: maplog; Owner: postgres
- --
- ALTER TABLE ONLY maplog.unit_to_sensor
- ADD CONSTRAINT uts_unitid_fk FOREIGN KEY (unit_id) REFERENCES maplog.unit(unit_id) ON UPDATE CASCADE ON DELETE CASCADE;
- --
- -- TOC entry 3862 (class 0 OID 0)
- -- Dependencies: 7
- -- Name: SCHEMA public; Type: ACL; Schema: -; Owner: postgres
- --
- REVOKE USAGE ON SCHEMA public FROM PUBLIC;
- GRANT ALL ON SCHEMA public TO PUBLIC;
- -- Completed on 2023-05-05 01:10:04
- --
- -- PostgreSQL database dump complete
- --
|