SHARE
TWEET

Untitled

a guest Jul 4th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
  8. SET statement_timeout = 0;
  9. SET lock_timeout = 0;
  10. SET idle_in_transaction_session_timeout = 0;
  11. SET client_encoding = 'UTF8';
  12. SET standard_conforming_strings = ON;
  13. SELECT pg_catalog.set_config('search_path', '', FALSE);
  14. SET check_function_bodies = FALSE;
  15. SET xmloption = content;
  16. SET client_min_messages = warning;
  17. SET row_security = off;
  18.  
  19. --
  20. -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
  21. --
  22.  
  23. CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
  24.  
  25.  
  26. --
  27. -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
  28. --
  29.  
  30. COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
  31.  
  32.  
  33. --
  34. -- Name: hstore; Type: EXTENSION; Schema: -; Owner:
  35. --
  36.  
  37. CREATE EXTENSION IF NOT EXISTS hstore WITH SCHEMA public;
  38.  
  39.  
  40. --
  41. -- Name: EXTENSION hstore; Type: COMMENT; Schema: -; Owner:
  42. --
  43.  
  44. COMMENT ON EXTENSION hstore IS 'data type for storing sets of (key, value) pairs';
  45.  
  46.  
  47. SET default_tablespace = '';
  48.  
  49. SET default_with_oids = FALSE;
  50.  
  51. --
  52. -- Name: device_ack; Type: TABLE; Schema: public; Owner: loraserver_as
  53. --
  54.  
  55. CREATE 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.  
  68. ALTER TABLE public.device_ack OWNER TO loraserver_as;
  69.  
  70. --
  71. -- Name: device_error; Type: TABLE; Schema: public; Owner: loraserver_as
  72. --
  73.  
  74. CREATE 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.  
  88. ALTER TABLE public.device_error OWNER TO loraserver_as;
  89.  
  90. --
  91. -- Name: device_join; Type: TABLE; Schema: public; Owner: loraserver_as
  92. --
  93.  
  94. CREATE 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.  
  106. ALTER TABLE public.device_join OWNER TO loraserver_as;
  107.  
  108. --
  109. -- Name: device_location; Type: TABLE; Schema: public; Owner: loraserver_as
  110. --
  111.  
  112. CREATE 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.  
  128. ALTER TABLE public.device_location OWNER TO loraserver_as;
  129.  
  130. --
  131. -- Name: device_status; Type: TABLE; Schema: public; Owner: loraserver_as
  132. --
  133.  
  134. CREATE 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.  
  149. ALTER TABLE public.device_status OWNER TO loraserver_as;
  150.  
  151. --
  152. -- Name: device_up; Type: TABLE; Schema: public; Owner: loraserver_as
  153. --
  154.  
  155. CREATE 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.  
  174. ALTER 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.  
  180. ALTER 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.  
  188. ALTER 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.  
  196. ALTER 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.  
  204. ALTER 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.  
  212. ALTER 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.  
  220. ALTER 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.  
  228. CREATE 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.  
  235. CREATE 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.  
  242. CREATE 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.  
  249. CREATE 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.  
  256. CREATE 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.  
  263. CREATE 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.  
  270. CREATE 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.  
  277. CREATE 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.  
  284. CREATE 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.  
  291. CREATE 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.  
  298. CREATE 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.  
  305. CREATE 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.  
  312. CREATE 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.  
  319. CREATE 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.  
  326. CREATE 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.  
  333. CREATE 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.  
  340. CREATE 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.  
  347. CREATE 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.  
  354. CREATE 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.  
  361. CREATE 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.  
  368. CREATE 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.  
  375. CREATE 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.  
  382. CREATE 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.  
  389. CREATE 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.  
  396. CREATE 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.  
  403. CREATE INDEX idx_device_up_tags ON public.device_up USING btree (tags);
  404.  
  405.  
  406. --
  407. -- PostgreSQL database dump complete
  408. --
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top