-
Notifications
You must be signed in to change notification settings - Fork 1
/
db.sql
356 lines (266 loc) · 14.5 KB
/
db.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
--
-- PostgreSQL database dump
--
-- Dumped from database version 13.5 (Ubuntu 13.5-1.pgdg20.04+1)
-- Dumped by pg_dump version 14.0
-- Started on 2021-12-08 23:49:40
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 4009 (class 1262 OID 2605218)
-- Name: dd39tvppugdkne; Type: DATABASE; Schema: -; Owner: -
--
CREATE DATABASE dd39tvppugdkne WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE = 'en_US.UTF-8';
\connect dd39tvppugdkne
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;
SET default_table_access_method = heap;
--
-- TOC entry 201 (class 1259 OID 2606405)
-- Name: Person; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public."Person" (
id integer NOT NULL,
"firstName" character varying NOT NULL,
"lastName" character varying NOT NULL,
email character varying NOT NULL,
"hashedPassword" character varying NOT NULL,
"isAdmin" boolean NOT NULL,
"intervalNotificationsEnabled" boolean NOT NULL,
"timeInterval" smallint NOT NULL,
"alarmNotificationsEnabled" boolean NOT NULL,
"minTemperature" double precision,
"maxTemperature" double precision,
"minPressure" double precision,
"maxPressure" double precision,
"minHumidity" double precision,
"maxHumidity" double precision,
"minAltitude" double precision,
"maxAltitude" double precision,
"arePreferencesSet" boolean NOT NULL
);
--
-- TOC entry 200 (class 1259 OID 2606403)
-- Name: Person_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public."Person_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 4010 (class 0 OID 0)
-- Dependencies: 200
-- Name: Person_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public."Person_id_seq" OWNED BY public."Person".id;
--
-- TOC entry 205 (class 1259 OID 2606426)
-- Name: Subscription; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public."Subscription" (
id integer NOT NULL,
"weatherStationId" integer,
"personId" integer
);
--
-- TOC entry 204 (class 1259 OID 2606424)
-- Name: Subscription_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public."Subscription_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 4011 (class 0 OID 0)
-- Dependencies: 204
-- Name: Subscription_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public."Subscription_id_seq" OWNED BY public."Subscription".id;
--
-- TOC entry 203 (class 1259 OID 2606418)
-- Name: WeatherStation; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public."WeatherStation" (
id integer NOT NULL,
"enabledState" boolean NOT NULL,
temperature double precision NOT NULL,
pressure double precision NOT NULL,
humidity double precision NOT NULL,
altitude double precision NOT NULL,
name character varying NOT NULL,
key character varying NOT NULL
);
--
-- TOC entry 202 (class 1259 OID 2606416)
-- Name: WeatherStation_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE public."WeatherStation_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 4012 (class 0 OID 0)
-- Dependencies: 202
-- Name: WeatherStation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE public."WeatherStation_id_seq" OWNED BY public."WeatherStation".id;
--
-- TOC entry 3851 (class 2604 OID 2606408)
-- Name: Person id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."Person" ALTER COLUMN id SET DEFAULT nextval('public."Person_id_seq"'::regclass);
--
-- TOC entry 3853 (class 2604 OID 2606429)
-- Name: Subscription id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."Subscription" ALTER COLUMN id SET DEFAULT nextval('public."Subscription_id_seq"'::regclass);
--
-- TOC entry 3852 (class 2604 OID 2606421)
-- Name: WeatherStation id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."WeatherStation" ALTER COLUMN id SET DEFAULT nextval('public."WeatherStation_id_seq"'::regclass);
--
-- TOC entry 3999 (class 0 OID 2606405)
-- Dependencies: 201
-- Data for Name: Person; Type: TABLE DATA; Schema: public; Owner: -
--
INSERT INTO public."Person" (id, "firstName", "lastName", email, "hashedPassword", "isAdmin", "intervalNotificationsEnabled", "timeInterval", "alarmNotificationsEnabled", "minTemperature", "maxTemperature", "minPressure", "maxPressure", "minHumidity", "maxHumidity", "minAltitude", "maxAltitude", "arePreferencesSet") VALUES (2, 'Sagar', 'Pathare', 'sagar.pathare@colorado.edu', '$2b$10$NOWnvERijP/uHFAsbuQxSuBSOb867E7rgdiC8D59991f0Ep3oCN8y', false, true, 1, true, 0, 40, 0, 200000, 0, 30, 1000, 2000, true);
INSERT INTO public."Person" (id, "firstName", "lastName", email, "hashedPassword", "isAdmin", "intervalNotificationsEnabled", "timeInterval", "alarmNotificationsEnabled", "minTemperature", "maxTemperature", "minPressure", "maxPressure", "minHumidity", "maxHumidity", "minAltitude", "maxAltitude", "arePreferencesSet") VALUES (7, 'A', 'B', 'ab@ab.com', '$2b$10$Ep2IcEc02ASXbFo1hPvSWurNSXZabfKRAEowX3OTgJFuq46FFE0vW', false, true, 4, true, 16, 35, 50000, 150000, 10, 65, 1000, 2000, true);
INSERT INTO public."Person" (id, "firstName", "lastName", email, "hashedPassword", "isAdmin", "intervalNotificationsEnabled", "timeInterval", "alarmNotificationsEnabled", "minTemperature", "maxTemperature", "minPressure", "maxPressure", "minHumidity", "maxHumidity", "minAltitude", "maxAltitude", "arePreferencesSet") VALUES (6, 'X', 'Y', 'xy@z.com', '$2b$10$VknQwAiNrbIpLirpFjm1SOqvzDgR3G44Q6Et1SGNzTI0jErm9MQ2C', false, false, 4, false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, false);
INSERT INTO public."Person" (id, "firstName", "lastName", email, "hashedPassword", "isAdmin", "intervalNotificationsEnabled", "timeInterval", "alarmNotificationsEnabled", "minTemperature", "maxTemperature", "minPressure", "maxPressure", "minHumidity", "maxHumidity", "minAltitude", "maxAltitude", "arePreferencesSet") VALUES (3, 'Vimal', 'Kakaraparthi', 'vimalkakaraparti@gmail.com', '$2b$10$yHbLvut3Z4l/8bTEV8hz8uI0WmUQapxG9zLqw0vL4UrKIf1ZjRYLe', false, true, 4, false, 0, 40, 0, 200000, 0, 30, 1000, 2000, true);
INSERT INTO public."Person" (id, "firstName", "lastName", email, "hashedPassword", "isAdmin", "intervalNotificationsEnabled", "timeInterval", "alarmNotificationsEnabled", "minTemperature", "maxTemperature", "minPressure", "maxPressure", "minHumidity", "maxHumidity", "minAltitude", "maxAltitude", "arePreferencesSet") VALUES (8, 'Alex2', 'Brown', 'alex@brown.com', '$2b$10$kfgHdCAIwtIqjskz0yass.KnQrIWDlmsCq0bRz8ZTp0Gr2VIb5zOS', false, false, 2, true, 16, 35, 50000, 150000, 10, 65, 1000, 2000, true);
INSERT INTO public."Person" (id, "firstName", "lastName", email, "hashedPassword", "isAdmin", "intervalNotificationsEnabled", "timeInterval", "alarmNotificationsEnabled", "minTemperature", "maxTemperature", "minPressure", "maxPressure", "minHumidity", "maxHumidity", "minAltitude", "maxAltitude", "arePreferencesSet") VALUES (9, 'Alex', 'Green', 'alex@green.com', '$2b$10$VxITgiJN.1caD0YPsS0Ot.WEZlsTriVj80b3IedCMnVL.OVaQqAMS', false, true, 4, true, 16, 35, 50000, 150000, 10, 65, 1000, 2000, true);
INSERT INTO public."Person" (id, "firstName", "lastName", email, "hashedPassword", "isAdmin", "intervalNotificationsEnabled", "timeInterval", "alarmNotificationsEnabled", "minTemperature", "maxTemperature", "minPressure", "maxPressure", "minHumidity", "maxHumidity", "minAltitude", "maxAltitude", "arePreferencesSet") VALUES (1, 'Admin', 'Last', 'a@b.com', '$2b$10$2t4mXoHMI11E27ps8Y3pf.a9RjP6nT4wbqdKqoz7VmpSDrLC/xqKG', true, false, 4, false, 0, 40, 0, 200000, 0, 30, 1000, 2000, true);
INSERT INTO public."Person" (id, "firstName", "lastName", email, "hashedPassword", "isAdmin", "intervalNotificationsEnabled", "timeInterval", "alarmNotificationsEnabled", "minTemperature", "maxTemperature", "minPressure", "maxPressure", "minHumidity", "maxHumidity", "minAltitude", "maxAltitude", "arePreferencesSet") VALUES (5, 'Sagar2', 'Pathare', 'sagar.pathare+1@colorado.edu', '$2b$10$PGweU7kAWJ7/7pbiDt0ZFOqAcDOUZodBHs3ojojVtf6rXbU28mAXy', false, true, 1, true, 0, 40, 0, 200000, 0, 30, 1000, 2000, true);
--
-- TOC entry 4003 (class 0 OID 2606426)
-- Dependencies: 205
-- Data for Name: Subscription; Type: TABLE DATA; Schema: public; Owner: -
--
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (88, 1, 2);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (89, 2, 2);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (90, 3, 2);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (91, 4, 2);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (92, 1, 7);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (93, 2, 7);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (30, 1, 1);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (31, 2, 1);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (32, 3, 1);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (33, 4, 1);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (94, 3, 7);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (95, 4, 7);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (106, 4, 3);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (54, 2, 5);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (55, 3, 5);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (117, 1, 8);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (118, 2, 8);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (119, 3, 8);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (120, 4, 8);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (121, 1, 9);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (122, 2, 9);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (123, 3, 9);
INSERT INTO public."Subscription" (id, "weatherStationId", "personId") VALUES (124, 4, 9);
--
-- TOC entry 4001 (class 0 OID 2606418)
-- Dependencies: 203
-- Data for Name: WeatherStation; Type: TABLE DATA; Schema: public; Owner: -
--
INSERT INTO public."WeatherStation" (id, "enabledState", temperature, pressure, humidity, altitude, name, key) VALUES (4, true, 25.3, 82340, 92.4, 1716.1, 'Weather Station 4', 'kxovumoysaslqalizjapnbkhvmhunrdd');
INSERT INTO public."WeatherStation" (id, "enabledState", temperature, pressure, humidity, altitude, name, key) VALUES (1, true, 23.9, 83019, 20.1, 1649.5, 'Weather Station 1', 'gekpeiakemwnrjhlckmimicinuocbkgc');
INSERT INTO public."WeatherStation" (id, "enabledState", temperature, pressure, humidity, altitude, name, key) VALUES (3, true, 22.1, 82277, 22.2, 1722.3, 'Weather Station 3', 'lpjvpcrhqbgumkarsxkwrpkmvdvwjkaj');
INSERT INTO public."WeatherStation" (id, "enabledState", temperature, pressure, humidity, altitude, name, key) VALUES (2, false, 22.3, 82400, 22.3, 1710.2, 'Weather Station 2', 'kkztpimkpbsyauczeekmnrgkyopnbpws');
--
-- TOC entry 4013 (class 0 OID 0)
-- Dependencies: 200
-- Name: Person_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('public."Person_id_seq"', 9, true);
--
-- TOC entry 4014 (class 0 OID 0)
-- Dependencies: 204
-- Name: Subscription_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('public."Subscription_id_seq"', 124, true);
--
-- TOC entry 4015 (class 0 OID 0)
-- Dependencies: 202
-- Name: WeatherStation_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('public."WeatherStation_id_seq"', 4, true);
--
-- TOC entry 3855 (class 2606 OID 2606415)
-- Name: Person Person_email_key; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."Person"
ADD CONSTRAINT "Person_email_key" UNIQUE (email);
--
-- TOC entry 3857 (class 2606 OID 2606413)
-- Name: Person Person_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."Person"
ADD CONSTRAINT "Person_pkey" PRIMARY KEY (id);
--
-- TOC entry 3863 (class 2606 OID 2606431)
-- Name: Subscription Subscription_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."Subscription"
ADD CONSTRAINT "Subscription_pkey" PRIMARY KEY (id);
--
-- TOC entry 3865 (class 2606 OID 2692666)
-- Name: Subscription Subscription_station_person_key; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."Subscription"
ADD CONSTRAINT "Subscription_station_person_key" UNIQUE ("weatherStationId", "personId");
--
-- TOC entry 3859 (class 2606 OID 2684236)
-- Name: WeatherStation WeatherStation_key_key; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."WeatherStation"
ADD CONSTRAINT "WeatherStation_key_key" UNIQUE (key);
--
-- TOC entry 3861 (class 2606 OID 2606423)
-- Name: WeatherStation WeatherStation_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."WeatherStation"
ADD CONSTRAINT "WeatherStation_pkey" PRIMARY KEY (id);
--
-- TOC entry 3867 (class 2606 OID 2606437)
-- Name: Subscription Subscription_personId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."Subscription"
ADD CONSTRAINT "Subscription_personId_fkey" FOREIGN KEY ("personId") REFERENCES public."Person"(id);
--
-- TOC entry 3866 (class 2606 OID 2606432)
-- Name: Subscription Subscription_weatherStationId_fkey; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public."Subscription"
ADD CONSTRAINT "Subscription_weatherStationId_fkey" FOREIGN KEY ("weatherStationId") REFERENCES public."WeatherStation"(id);
-- Completed on 2021-12-08 23:49:47
--
-- PostgreSQL database dump complete
--