-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup.sql
More file actions
449 lines (299 loc) · 10.6 KB
/
backup.sql
File metadata and controls
449 lines (299 loc) · 10.6 KB
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
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
--
-- PostgreSQL database dump
--
\restrict IowMvQDPXk6Hv8ZnQbSQpRPkYy1rlR9Zhx2cS9vo6dW0dryf1Dl0jGHJfne0qut
-- Dumped from database version 15.14
-- Dumped by pg_dump version 15.14
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_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: comment; Type: TABLE; Schema: public; Owner: intimateuser
--
CREATE TABLE public.comment (
id integer NOT NULL,
encounter_id integer NOT NULL,
user_id integer NOT NULL,
text text NOT NULL,
rating integer,
suggestions text,
created_at timestamp without time zone
);
ALTER TABLE public.comment OWNER TO intimateuser;
--
-- Name: comment_id_seq; Type: SEQUENCE; Schema: public; Owner: intimateuser
--
CREATE SEQUENCE public.comment_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.comment_id_seq OWNER TO intimateuser;
--
-- Name: comment_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: intimateuser
--
ALTER SEQUENCE public.comment_id_seq OWNED BY public.comment.id;
--
-- Name: custom_icon; Type: TABLE; Schema: public; Owner: intimateuser
--
CREATE TABLE public.custom_icon (
id integer NOT NULL,
"position" character varying(50) NOT NULL,
svg_content text NOT NULL,
created_at timestamp without time zone
);
ALTER TABLE public.custom_icon OWNER TO intimateuser;
--
-- Name: custom_icon_id_seq; Type: SEQUENCE; Schema: public; Owner: intimateuser
--
CREATE SEQUENCE public.custom_icon_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.custom_icon_id_seq OWNER TO intimateuser;
--
-- Name: custom_icon_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: intimateuser
--
ALTER SEQUENCE public.custom_icon_id_seq OWNED BY public.custom_icon.id;
--
-- Name: encounter; Type: TABLE; Schema: public; Owner: intimateuser
--
CREATE TABLE public.encounter (
id integer NOT NULL,
user_id integer NOT NULL,
date date NOT NULL,
"time" time without time zone,
"position" character varying(50) NOT NULL,
duration integer,
notes text,
rating integer,
created_at timestamp without time zone
);
ALTER TABLE public.encounter OWNER TO intimateuser;
--
-- Name: encounter_id_seq; Type: SEQUENCE; Schema: public; Owner: intimateuser
--
CREATE SEQUENCE public.encounter_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.encounter_id_seq OWNER TO intimateuser;
--
-- Name: encounter_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: intimateuser
--
ALTER SEQUENCE public.encounter_id_seq OWNED BY public.encounter.id;
--
-- Name: notification; Type: TABLE; Schema: public; Owner: intimateuser
--
CREATE TABLE public.notification (
id integer NOT NULL,
user_id integer NOT NULL,
encounter_id integer,
type character varying(50) NOT NULL,
message character varying(200) NOT NULL,
read boolean,
created_at timestamp without time zone
);
ALTER TABLE public.notification OWNER TO intimateuser;
--
-- Name: notification_id_seq; Type: SEQUENCE; Schema: public; Owner: intimateuser
--
CREATE SEQUENCE public.notification_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.notification_id_seq OWNER TO intimateuser;
--
-- Name: notification_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: intimateuser
--
ALTER SEQUENCE public.notification_id_seq OWNED BY public.notification.id;
--
-- Name: user; Type: TABLE; Schema: public; Owner: intimateuser
--
CREATE TABLE public."user" (
id integer NOT NULL,
username character varying(80) NOT NULL,
password_hash character varying(200) NOT NULL,
partner_code character varying(50),
partner_id integer,
full_name character varying(200),
phone_number character varying(20),
private_notes text,
sms_notifications boolean
);
ALTER TABLE public."user" OWNER TO intimateuser;
--
-- Name: user_id_seq; Type: SEQUENCE; Schema: public; Owner: intimateuser
--
CREATE SEQUENCE public.user_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.user_id_seq OWNER TO intimateuser;
--
-- Name: user_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: intimateuser
--
ALTER SEQUENCE public.user_id_seq OWNED BY public."user".id;
--
-- Name: comment id; Type: DEFAULT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public.comment ALTER COLUMN id SET DEFAULT nextval('public.comment_id_seq'::regclass);
--
-- Name: custom_icon id; Type: DEFAULT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public.custom_icon ALTER COLUMN id SET DEFAULT nextval('public.custom_icon_id_seq'::regclass);
--
-- Name: encounter id; Type: DEFAULT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public.encounter ALTER COLUMN id SET DEFAULT nextval('public.encounter_id_seq'::regclass);
--
-- Name: notification id; Type: DEFAULT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public.notification ALTER COLUMN id SET DEFAULT nextval('public.notification_id_seq'::regclass);
--
-- Name: user id; Type: DEFAULT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public."user" ALTER COLUMN id SET DEFAULT nextval('public.user_id_seq'::regclass);
--
-- Data for Name: comment; Type: TABLE DATA; Schema: public; Owner: intimateuser
--
COPY public.comment (id, encounter_id, user_id, text, rating, suggestions, created_at) FROM stdin;
\.
--
-- Data for Name: custom_icon; Type: TABLE DATA; Schema: public; Owner: intimateuser
--
COPY public.custom_icon (id, "position", svg_content, created_at) FROM stdin;
\.
--
-- Data for Name: encounter; Type: TABLE DATA; Schema: public; Owner: intimateuser
--
COPY public.encounter (id, user_id, date, "time", "position", duration, notes, rating, created_at) FROM stdin;
\.
--
-- Data for Name: notification; Type: TABLE DATA; Schema: public; Owner: intimateuser
--
COPY public.notification (id, user_id, encounter_id, type, message, read, created_at) FROM stdin;
\.
--
-- Data for Name: user; Type: TABLE DATA; Schema: public; Owner: intimateuser
--
COPY public."user" (id, username, password_hash, partner_code, partner_id, full_name, phone_number, private_notes, sms_notifications) FROM stdin;
1 wingnut144 scrypt:32768:8:1$5NPrEBEHzPcFibTI$b9d76fc1e1a37272965b7bc8b5ed73b3ce1053767596421a8c4faa852d4dd22bf94610eabc8bf590c246500ca04a29f894d95b0430501feb7fdc6dd1c0637ab9 0c515f2856ae99ee \N \N \N \N f
\.
--
-- Name: comment_id_seq; Type: SEQUENCE SET; Schema: public; Owner: intimateuser
--
SELECT pg_catalog.setval('public.comment_id_seq', 1, false);
--
-- Name: custom_icon_id_seq; Type: SEQUENCE SET; Schema: public; Owner: intimateuser
--
SELECT pg_catalog.setval('public.custom_icon_id_seq', 1, false);
--
-- Name: encounter_id_seq; Type: SEQUENCE SET; Schema: public; Owner: intimateuser
--
SELECT pg_catalog.setval('public.encounter_id_seq', 1, false);
--
-- Name: notification_id_seq; Type: SEQUENCE SET; Schema: public; Owner: intimateuser
--
SELECT pg_catalog.setval('public.notification_id_seq', 1, false);
--
-- Name: user_id_seq; Type: SEQUENCE SET; Schema: public; Owner: intimateuser
--
SELECT pg_catalog.setval('public.user_id_seq', 1, true);
--
-- Name: comment comment_pkey; Type: CONSTRAINT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public.comment
ADD CONSTRAINT comment_pkey PRIMARY KEY (id);
--
-- Name: custom_icon custom_icon_pkey; Type: CONSTRAINT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public.custom_icon
ADD CONSTRAINT custom_icon_pkey PRIMARY KEY (id);
--
-- Name: custom_icon custom_icon_position_key; Type: CONSTRAINT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public.custom_icon
ADD CONSTRAINT custom_icon_position_key UNIQUE ("position");
--
-- Name: encounter encounter_pkey; Type: CONSTRAINT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public.encounter
ADD CONSTRAINT encounter_pkey PRIMARY KEY (id);
--
-- Name: notification notification_pkey; Type: CONSTRAINT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public.notification
ADD CONSTRAINT notification_pkey PRIMARY KEY (id);
--
-- Name: user user_partner_code_key; Type: CONSTRAINT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public."user"
ADD CONSTRAINT user_partner_code_key UNIQUE (partner_code);
--
-- Name: user user_pkey; Type: CONSTRAINT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public."user"
ADD CONSTRAINT user_pkey PRIMARY KEY (id);
--
-- Name: user user_username_key; Type: CONSTRAINT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public."user"
ADD CONSTRAINT user_username_key UNIQUE (username);
--
-- Name: comment comment_encounter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public.comment
ADD CONSTRAINT comment_encounter_id_fkey FOREIGN KEY (encounter_id) REFERENCES public.encounter(id);
--
-- Name: comment comment_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public.comment
ADD CONSTRAINT comment_user_id_fkey FOREIGN KEY (user_id) REFERENCES public."user"(id);
--
-- Name: encounter encounter_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public.encounter
ADD CONSTRAINT encounter_user_id_fkey FOREIGN KEY (user_id) REFERENCES public."user"(id);
--
-- Name: notification notification_encounter_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public.notification
ADD CONSTRAINT notification_encounter_id_fkey FOREIGN KEY (encounter_id) REFERENCES public.encounter(id);
--
-- Name: notification notification_user_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public.notification
ADD CONSTRAINT notification_user_id_fkey FOREIGN KEY (user_id) REFERENCES public."user"(id);
--
-- Name: user user_partner_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: intimateuser
--
ALTER TABLE ONLY public."user"
ADD CONSTRAINT user_partner_id_fkey FOREIGN KEY (partner_id) REFERENCES public."user"(id);
--
-- PostgreSQL database dump complete
--
\unrestrict IowMvQDPXk6Hv8ZnQbSQpRPkYy1rlR9Zhx2cS9vo6dW0dryf1Dl0jGHJfne0qut