· 6 years ago · Jul 04, 2019, 02:12 PM
1--
2-- PostgreSQL database dump
3--
4
5-- Dumped from database version 9.6.13
6-- Dumped by pg_dump version 9.6.13
7
8SET statement_timeout = 0;
9SET lock_timeout = 0;
10SET idle_in_transaction_session_timeout = 0;
11SET client_encoding = 'UTF8';
12SET standard_conforming_strings = on;
13SELECT pg_catalog.set_config('search_path', '', false);
14SET check_function_bodies = false;
15SET xmloption = content;
16SET client_min_messages = warning;
17SET row_security = off;
18
19--
20-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
21--
22
23CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
24
25
26--
27-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
28--
29
30COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
31
32
33--
34-- Name: hstore; Type: EXTENSION; Schema: -; Owner:
35--
36
37CREATE EXTENSION IF NOT EXISTS hstore WITH SCHEMA public;
38
39
40--
41-- Name: EXTENSION hstore; Type: COMMENT; Schema: -; Owner:
42--
43
44COMMENT ON EXTENSION hstore IS 'data type for storing sets of (key, value) pairs';
45
46
47SET default_tablespace = '';
48
49SET default_with_oids = false;
50
51--
52-- Name: device_ack; Type: TABLE; Schema: public; Owner: loraserver_as
53--
54
55CREATE TABLE public.device_ack (
56 id uuid NOT NULL,
57 received_at timestamp with time zone NOT NULL,
58 dev_eui bytea NOT NULL,
59 device_name character varying(100) NOT NULL,
60 application_id bigint NOT NULL,
61 application_name character varying(100) NOT NULL,
62 acknowledged boolean NOT NULL,
63 f_cnt bigint NOT NULL,
64 tags public.hstore NOT NULL
65);
66
67
68ALTER TABLE public.device_ack OWNER TO loraserver_as;
69
70--
71-- Name: device_error; Type: TABLE; Schema: public; Owner: loraserver_as
72--
73
74CREATE TABLE public.device_error (
75 id uuid NOT NULL,
76 received_at timestamp with time zone NOT NULL,
77 dev_eui bytea NOT NULL,
78 device_name character varying(100) NOT NULL,
79 application_id bigint NOT NULL,
80 application_name character varying(100) NOT NULL,
81 type character varying(100) NOT NULL,
82 error text NOT NULL,
83 f_cnt bigint NOT NULL,
84 tags public.hstore NOT NULL
85);
86
87
88ALTER TABLE public.device_error OWNER TO loraserver_as;
89
90--
91-- Name: device_join; Type: TABLE; Schema: public; Owner: loraserver_as
92--
93
94CREATE TABLE public.device_join (
95 id uuid NOT NULL,
96 received_at timestamp with time zone NOT NULL,
97 dev_eui bytea NOT NULL,
98 device_name character varying(100) NOT NULL,
99 application_id bigint NOT NULL,
100 application_name character varying(100) NOT NULL,
101 dev_addr bytea NOT NULL,
102 tags public.hstore NOT NULL
103);
104
105
106ALTER TABLE public.device_join OWNER TO loraserver_as;
107
108--
109-- Name: device_location; Type: TABLE; Schema: public; Owner: loraserver_as
110--
111
112CREATE TABLE public.device_location (
113 id uuid NOT NULL,
114 received_at timestamp with time zone NOT NULL,
115 dev_eui bytea NOT NULL,
116 device_name character varying(100) NOT NULL,
117 application_id bigint NOT NULL,
118 application_name character varying(100) NOT NULL,
119 altitude double precision NOT NULL,
120 latitude double precision NOT NULL,
121 longitude double precision NOT NULL,
122 geohash character varying(12) NOT NULL,
123 tags public.hstore NOT NULL,
124 accuracy smallint NOT NULL
125);
126
127
128ALTER TABLE public.device_location OWNER TO loraserver_as;
129
130--
131-- Name: device_status; Type: TABLE; Schema: public; Owner: loraserver_as
132--
133
134CREATE TABLE public.device_status (
135 id uuid NOT NULL,
136 received_at timestamp with time zone NOT NULL,
137 dev_eui bytea NOT NULL,
138 device_name character varying(100) NOT NULL,
139 application_id bigint NOT NULL,
140 application_name character varying(100) NOT NULL,
141 margin smallint NOT NULL,
142 external_power_source boolean NOT NULL,
143 battery_level_unavailable boolean NOT NULL,
144 battery_level numeric(5,2) NOT NULL,
145 tags public.hstore NOT NULL
146);
147
148
149ALTER TABLE public.device_status OWNER TO loraserver_as;
150
151--
152-- Name: device_up; Type: TABLE; Schema: public; Owner: loraserver_as
153--
154
155CREATE TABLE public.device_up (
156 id uuid NOT NULL,
157 received_at timestamp with time zone NOT NULL,
158 dev_eui bytea NOT NULL,
159 device_name character varying(100) NOT NULL,
160 application_id bigint NOT NULL,
161 application_name character varying(100) NOT NULL,
162 frequency bigint NOT NULL,
163 dr smallint NOT NULL,
164 adr boolean NOT NULL,
165 f_cnt bigint NOT NULL,
166 f_port smallint NOT NULL,
167 tags public.hstore NOT NULL,
168 data bytea NOT NULL,
169 rx_info jsonb NOT NULL,
170 object jsonb NOT NULL
171);
172
173
174ALTER TABLE public.device_up OWNER TO loraserver_as;
175
176--
177-- Name: device_ack device_ack_pkey; Type: CONSTRAINT; Schema: public; Owner: loraserver_as
178--
179
180ALTER TABLE ONLY public.device_ack
181 ADD CONSTRAINT device_ack_pkey PRIMARY KEY (id);
182
183
184--
185-- Name: device_error device_error_pkey; Type: CONSTRAINT; Schema: public; Owner: loraserver_as
186--
187
188ALTER TABLE ONLY public.device_error
189 ADD CONSTRAINT device_error_pkey PRIMARY KEY (id);
190
191
192--
193-- Name: device_join device_join_pkey; Type: CONSTRAINT; Schema: public; Owner: loraserver_as
194--
195
196ALTER TABLE ONLY public.device_join
197 ADD CONSTRAINT device_join_pkey PRIMARY KEY (id);
198
199
200--
201-- Name: device_location device_location_pkey; Type: CONSTRAINT; Schema: public; Owner: loraserver_as
202--
203
204ALTER TABLE ONLY public.device_location
205 ADD CONSTRAINT device_location_pkey PRIMARY KEY (id);
206
207
208--
209-- Name: device_status device_status_pkey; Type: CONSTRAINT; Schema: public; Owner: loraserver_as
210--
211
212ALTER TABLE ONLY public.device_status
213 ADD CONSTRAINT device_status_pkey PRIMARY KEY (id);
214
215
216--
217-- Name: device_up device_up_pkey; Type: CONSTRAINT; Schema: public; Owner: loraserver_as
218--
219
220ALTER TABLE ONLY public.device_up
221 ADD CONSTRAINT device_up_pkey PRIMARY KEY (id);
222
223
224--
225-- Name: idx_device_ack_application_id; Type: INDEX; Schema: public; Owner: loraserver_as
226--
227
228CREATE INDEX idx_device_ack_application_id ON public.device_ack USING btree (application_id);
229
230
231--
232-- Name: idx_device_ack_dev_eui; Type: INDEX; Schema: public; Owner: loraserver_as
233--
234
235CREATE INDEX idx_device_ack_dev_eui ON public.device_ack USING btree (dev_eui);
236
237
238--
239-- Name: idx_device_ack_received_at; Type: INDEX; Schema: public; Owner: loraserver_as
240--
241
242CREATE INDEX idx_device_ack_received_at ON public.device_ack USING btree (received_at);
243
244
245--
246-- Name: idx_device_ack_tags; Type: INDEX; Schema: public; Owner: loraserver_as
247--
248
249CREATE INDEX idx_device_ack_tags ON public.device_ack USING btree (tags);
250
251
252--
253-- Name: idx_device_error_application_id; Type: INDEX; Schema: public; Owner: loraserver_as
254--
255
256CREATE INDEX idx_device_error_application_id ON public.device_error USING btree (application_id);
257
258
259--
260-- Name: idx_device_error_dev_eui; Type: INDEX; Schema: public; Owner: loraserver_as
261--
262
263CREATE INDEX idx_device_error_dev_eui ON public.device_error USING btree (dev_eui);
264
265
266--
267-- Name: idx_device_error_received_at; Type: INDEX; Schema: public; Owner: loraserver_as
268--
269
270CREATE INDEX idx_device_error_received_at ON public.device_error USING btree (received_at);
271
272
273--
274-- Name: idx_device_error_tags; Type: INDEX; Schema: public; Owner: loraserver_as
275--
276
277CREATE INDEX idx_device_error_tags ON public.device_error USING btree (tags);
278
279
280--
281-- Name: idx_device_join_application_id; Type: INDEX; Schema: public; Owner: loraserver_as
282--
283
284CREATE INDEX idx_device_join_application_id ON public.device_join USING btree (application_id);
285
286
287--
288-- Name: idx_device_join_dev_eui; Type: INDEX; Schema: public; Owner: loraserver_as
289--
290
291CREATE INDEX idx_device_join_dev_eui ON public.device_join USING btree (dev_eui);
292
293
294--
295-- Name: idx_device_join_received_at; Type: INDEX; Schema: public; Owner: loraserver_as
296--
297
298CREATE INDEX idx_device_join_received_at ON public.device_join USING btree (received_at);
299
300
301--
302-- Name: idx_device_join_tags; Type: INDEX; Schema: public; Owner: loraserver_as
303--
304
305CREATE INDEX idx_device_join_tags ON public.device_join USING btree (tags);
306
307
308--
309-- Name: idx_device_location_application_id; Type: INDEX; Schema: public; Owner: loraserver_as
310--
311
312CREATE INDEX idx_device_location_application_id ON public.device_location USING btree (application_id);
313
314
315--
316-- Name: idx_device_location_dev_eui; Type: INDEX; Schema: public; Owner: loraserver_as
317--
318
319CREATE INDEX idx_device_location_dev_eui ON public.device_location USING btree (dev_eui);
320
321
322--
323-- Name: idx_device_location_received_at; Type: INDEX; Schema: public; Owner: loraserver_as
324--
325
326CREATE INDEX idx_device_location_received_at ON public.device_location USING btree (received_at);
327
328
329--
330-- Name: idx_device_location_tags; Type: INDEX; Schema: public; Owner: loraserver_as
331--
332
333CREATE INDEX idx_device_location_tags ON public.device_location USING btree (tags);
334
335
336--
337-- Name: idx_device_status_application_id; Type: INDEX; Schema: public; Owner: loraserver_as
338--
339
340CREATE INDEX idx_device_status_application_id ON public.device_status USING btree (application_id);
341
342
343--
344-- Name: idx_device_status_dev_eui; Type: INDEX; Schema: public; Owner: loraserver_as
345--
346
347CREATE INDEX idx_device_status_dev_eui ON public.device_status USING btree (dev_eui);
348
349
350--
351-- Name: idx_device_status_received_at; Type: INDEX; Schema: public; Owner: loraserver_as
352--
353
354CREATE INDEX idx_device_status_received_at ON public.device_status USING btree (received_at);
355
356
357--
358-- Name: idx_device_status_tags; Type: INDEX; Schema: public; Owner: loraserver_as
359--
360
361CREATE INDEX idx_device_status_tags ON public.device_status USING btree (tags);
362
363
364--
365-- Name: idx_device_up_application_id; Type: INDEX; Schema: public; Owner: loraserver_as
366--
367
368CREATE INDEX idx_device_up_application_id ON public.device_up USING btree (application_id);
369
370
371--
372-- Name: idx_device_up_dev_eui; Type: INDEX; Schema: public; Owner: loraserver_as
373--
374
375CREATE INDEX idx_device_up_dev_eui ON public.device_up USING btree (dev_eui);
376
377
378--
379-- Name: idx_device_up_dr; Type: INDEX; Schema: public; Owner: loraserver_as
380--
381
382CREATE INDEX idx_device_up_dr ON public.device_up USING btree (dr);
383
384
385--
386-- Name: idx_device_up_frequency; Type: INDEX; Schema: public; Owner: loraserver_as
387--
388
389CREATE INDEX idx_device_up_frequency ON public.device_up USING btree (frequency);
390
391
392--
393-- Name: idx_device_up_received_at; Type: INDEX; Schema: public; Owner: loraserver_as
394--
395
396CREATE INDEX idx_device_up_received_at ON public.device_up USING btree (received_at);
397
398
399--
400-- Name: idx_device_up_tags; Type: INDEX; Schema: public; Owner: loraserver_as
401--
402
403CREATE INDEX idx_device_up_tags ON public.device_up USING btree (tags);
404
405
406--
407-- PostgreSQL database dump complete
408--