-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPollingBackup.sql
More file actions
1051 lines (743 loc) · 32.5 KB
/
PollingBackup.sql
File metadata and controls
1051 lines (743 loc) · 32.5 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
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
--
-- PostgreSQL database dump
--
-- Dumped from database version 14.5
-- Dumped by pg_dump version 14.4
-- Started on 2022-10-24 22:20:07
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;
DROP DATABASE polling;
--
-- TOC entry 3407 (class 1262 OID 16394)
-- Name: polling; Type: DATABASE; Schema: -; Owner: postgres
--
CREATE DATABASE polling WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE = 'English_United States.1252';
ALTER DATABASE polling OWNER TO postgres;
\connect polling
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;
--
-- TOC entry 214 (class 1259 OID 16416)
-- Name: Candidate; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."Candidate" (
candidate_id integer NOT NULL,
name text NOT NULL,
polling_order_id integer NOT NULL
);
ALTER TABLE public."Candidate" OWNER TO postgres;
--
-- TOC entry 213 (class 1259 OID 16415)
-- Name: Candidate_candidate_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public."Candidate_candidate_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."Candidate_candidate_id_seq" OWNER TO postgres;
--
-- TOC entry 3408 (class 0 OID 0)
-- Dependencies: 213
-- Name: Candidate_candidate_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public."Candidate_candidate_id_seq" OWNED BY public."Candidate".candidate_id;
--
-- TOC entry 228 (class 1259 OID 16517)
-- Name: Candidate_polling_order_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public."Candidate_polling_order_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."Candidate_polling_order_id_seq" OWNER TO postgres;
--
-- TOC entry 3409 (class 0 OID 0)
-- Dependencies: 228
-- Name: Candidate_polling_order_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public."Candidate_polling_order_id_seq" OWNED BY public."Candidate".polling_order_id;
--
-- TOC entry 223 (class 1259 OID 16460)
-- Name: ExternalNotes; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."ExternalNotes" (
external_notes_id integer NOT NULL,
candidate_id integer NOT NULL,
polling_order_member_id integer NOT NULL,
external_note text NOT NULL,
en_created_at timestamp without time zone DEFAULT now() NOT NULL
);
ALTER TABLE public."ExternalNotes" OWNER TO postgres;
--
-- TOC entry 221 (class 1259 OID 16458)
-- Name: ExternalNotes_candidate_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public."ExternalNotes_candidate_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."ExternalNotes_candidate_id_seq" OWNER TO postgres;
--
-- TOC entry 3410 (class 0 OID 0)
-- Dependencies: 221
-- Name: ExternalNotes_candidate_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public."ExternalNotes_candidate_id_seq" OWNED BY public."ExternalNotes".candidate_id;
--
-- TOC entry 220 (class 1259 OID 16457)
-- Name: ExternalNotes_external_notes_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public."ExternalNotes_external_notes_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."ExternalNotes_external_notes_id_seq" OWNER TO postgres;
--
-- TOC entry 3411 (class 0 OID 0)
-- Dependencies: 220
-- Name: ExternalNotes_external_notes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public."ExternalNotes_external_notes_id_seq" OWNED BY public."ExternalNotes".external_notes_id;
--
-- TOC entry 222 (class 1259 OID 16459)
-- Name: ExternalNotes_ws_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public."ExternalNotes_ws_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."ExternalNotes_ws_id_seq" OWNER TO postgres;
--
-- TOC entry 3412 (class 0 OID 0)
-- Dependencies: 222
-- Name: ExternalNotes_ws_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public."ExternalNotes_ws_id_seq" OWNED BY public."ExternalNotes".polling_order_member_id;
--
-- TOC entry 212 (class 1259 OID 16407)
-- Name: Polling; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."Polling" (
polling_id integer NOT NULL,
polling_name text NOT NULL,
start_date date NOT NULL,
end_date date NOT NULL,
polling_order_id integer NOT NULL
);
ALTER TABLE public."Polling" OWNER TO postgres;
--
-- TOC entry 233 (class 1259 OID 24758)
-- Name: PollingCandidates; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."PollingCandidates" (
polling_id integer NOT NULL,
candidate_id integer NOT NULL,
polling_candidate_id integer NOT NULL
);
ALTER TABLE public."PollingCandidates" OWNER TO postgres;
--
-- TOC entry 232 (class 1259 OID 24757)
-- Name: PollingCandidates_polling_candidate_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public."PollingCandidates_polling_candidate_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."PollingCandidates_polling_candidate_id_seq" OWNER TO postgres;
--
-- TOC entry 3413 (class 0 OID 0)
-- Dependencies: 232
-- Name: PollingCandidates_polling_candidate_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public."PollingCandidates_polling_candidate_id_seq" OWNED BY public."PollingCandidates".polling_candidate_id;
--
-- TOC entry 219 (class 1259 OID 16428)
-- Name: PollingNotes; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."PollingNotes" (
polling_notes_id integer NOT NULL,
note text,
vote integer,
polling_id integer NOT NULL,
candidate_id integer NOT NULL,
polling_order_id integer NOT NULL,
pn_created_at timestamp without time zone DEFAULT now() NOT NULL,
polling_order_member_id integer NOT NULL,
completed boolean
);
ALTER TABLE public."PollingNotes" OWNER TO postgres;
--
-- TOC entry 217 (class 1259 OID 16426)
-- Name: PollingNotes_candidate_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public."PollingNotes_candidate_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."PollingNotes_candidate_id_seq" OWNER TO postgres;
--
-- TOC entry 3414 (class 0 OID 0)
-- Dependencies: 217
-- Name: PollingNotes_candidate_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public."PollingNotes_candidate_id_seq" OWNED BY public."PollingNotes".candidate_id;
--
-- TOC entry 216 (class 1259 OID 16425)
-- Name: PollingNotes_polling_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public."PollingNotes_polling_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."PollingNotes_polling_id_seq" OWNER TO postgres;
--
-- TOC entry 3415 (class 0 OID 0)
-- Dependencies: 216
-- Name: PollingNotes_polling_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public."PollingNotes_polling_id_seq" OWNED BY public."PollingNotes".polling_id;
--
-- TOC entry 215 (class 1259 OID 16424)
-- Name: PollingNotes_polling_notes_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public."PollingNotes_polling_notes_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."PollingNotes_polling_notes_id_seq" OWNER TO postgres;
--
-- TOC entry 3416 (class 0 OID 0)
-- Dependencies: 215
-- Name: PollingNotes_polling_notes_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public."PollingNotes_polling_notes_id_seq" OWNED BY public."PollingNotes".polling_notes_id;
--
-- TOC entry 218 (class 1259 OID 16427)
-- Name: PollingNotes_ws_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public."PollingNotes_ws_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."PollingNotes_ws_id_seq" OWNER TO postgres;
--
-- TOC entry 3417 (class 0 OID 0)
-- Dependencies: 218
-- Name: PollingNotes_ws_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public."PollingNotes_ws_id_seq" OWNED BY public."PollingNotes".polling_order_id;
--
-- TOC entry 225 (class 1259 OID 16481)
-- Name: PollingOrder; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."PollingOrder" (
polling_order_id integer NOT NULL,
polling_order_name text,
polling_order_admin integer NOT NULL,
polling_order_admin_assistant integer NOT NULL
);
ALTER TABLE public."PollingOrder" OWNER TO postgres;
--
-- TOC entry 210 (class 1259 OID 16397)
-- Name: PollingOrderMember; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public."PollingOrderMember" (
polling_order_member_id integer NOT NULL,
name text NOT NULL,
email text NOT NULL,
password text,
polling_order_id integer NOT NULL,
pom_created_at date NOT NULL,
new_password_token integer,
new_password_token_timestamp date,
approved boolean DEFAULT false NOT NULL
);
ALTER TABLE public."PollingOrderMember" OWNER TO postgres;
--
-- TOC entry 226 (class 1259 OID 16489)
-- Name: PollingOrderMember_polling_order_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public."PollingOrderMember_polling_order_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."PollingOrderMember_polling_order_id_seq" OWNER TO postgres;
--
-- TOC entry 3418 (class 0 OID 0)
-- Dependencies: 226
-- Name: PollingOrderMember_polling_order_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public."PollingOrderMember_polling_order_id_seq" OWNED BY public."PollingOrderMember".polling_order_id;
--
-- TOC entry 231 (class 1259 OID 16549)
-- Name: PollingOrderMember_polling_order_member_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
ALTER TABLE public."PollingOrderMember" ALTER COLUMN polling_order_member_id ADD GENERATED ALWAYS AS IDENTITY (
SEQUENCE NAME public."PollingOrderMember_polling_order_member_id_seq"
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
--
-- TOC entry 230 (class 1259 OID 16538)
-- Name: PollingOrder_polling_order_admin_assistant_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public."PollingOrder_polling_order_admin_assistant_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."PollingOrder_polling_order_admin_assistant_seq" OWNER TO postgres;
--
-- TOC entry 3419 (class 0 OID 0)
-- Dependencies: 230
-- Name: PollingOrder_polling_order_admin_assistant_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public."PollingOrder_polling_order_admin_assistant_seq" OWNED BY public."PollingOrder".polling_order_admin_assistant;
--
-- TOC entry 229 (class 1259 OID 16530)
-- Name: PollingOrder_polling_order_admin_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public."PollingOrder_polling_order_admin_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."PollingOrder_polling_order_admin_seq" OWNER TO postgres;
--
-- TOC entry 3420 (class 0 OID 0)
-- Dependencies: 229
-- Name: PollingOrder_polling_order_admin_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public."PollingOrder_polling_order_admin_seq" OWNED BY public."PollingOrder".polling_order_admin;
--
-- TOC entry 224 (class 1259 OID 16480)
-- Name: PollingOrder_polling_order_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public."PollingOrder_polling_order_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."PollingOrder_polling_order_id_seq" OWNER TO postgres;
--
-- TOC entry 3421 (class 0 OID 0)
-- Dependencies: 224
-- Name: PollingOrder_polling_order_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public."PollingOrder_polling_order_id_seq" OWNED BY public."PollingOrder".polling_order_id;
--
-- TOC entry 211 (class 1259 OID 16406)
-- Name: Polling_polling_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public."Polling_polling_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."Polling_polling_id_seq" OWNER TO postgres;
--
-- TOC entry 3422 (class 0 OID 0)
-- Dependencies: 211
-- Name: Polling_polling_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public."Polling_polling_id_seq" OWNED BY public."Polling".polling_id;
--
-- TOC entry 227 (class 1259 OID 16503)
-- Name: Polling_polling_order_member_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public."Polling_polling_order_member_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."Polling_polling_order_member_id_seq" OWNER TO postgres;
--
-- TOC entry 3423 (class 0 OID 0)
-- Dependencies: 227
-- Name: Polling_polling_order_member_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public."Polling_polling_order_member_id_seq" OWNED BY public."Polling".polling_order_id;
--
-- TOC entry 209 (class 1259 OID 16396)
-- Name: WhiteScarves_ws_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public."WhiteScarves_ws_id_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."WhiteScarves_ws_id_seq" OWNER TO postgres;
--
-- TOC entry 3424 (class 0 OID 0)
-- Dependencies: 209
-- Name: WhiteScarves_ws_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public."WhiteScarves_ws_id_seq" OWNED BY public."PollingOrderMember".polling_order_member_id;
--
-- TOC entry 3207 (class 2604 OID 16419)
-- Name: Candidate candidate_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Candidate" ALTER COLUMN candidate_id SET DEFAULT nextval('public."Candidate_candidate_id_seq"'::regclass);
--
-- TOC entry 3210 (class 2604 OID 16463)
-- Name: ExternalNotes external_notes_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."ExternalNotes" ALTER COLUMN external_notes_id SET DEFAULT nextval('public."ExternalNotes_external_notes_id_seq"'::regclass);
--
-- TOC entry 3206 (class 2604 OID 16410)
-- Name: Polling polling_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Polling" ALTER COLUMN polling_id SET DEFAULT nextval('public."Polling_polling_id_seq"'::regclass);
--
-- TOC entry 3213 (class 2604 OID 24761)
-- Name: PollingCandidates polling_candidate_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."PollingCandidates" ALTER COLUMN polling_candidate_id SET DEFAULT nextval('public."PollingCandidates_polling_candidate_id_seq"'::regclass);
--
-- TOC entry 3208 (class 2604 OID 16431)
-- Name: PollingNotes polling_notes_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."PollingNotes" ALTER COLUMN polling_notes_id SET DEFAULT nextval('public."PollingNotes_polling_notes_id_seq"'::regclass);
--
-- TOC entry 3212 (class 2604 OID 16484)
-- Name: PollingOrder polling_order_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."PollingOrder" ALTER COLUMN polling_order_id SET DEFAULT nextval('public."PollingOrder_polling_order_id_seq"'::regclass);
--
-- TOC entry 3382 (class 0 OID 16416)
-- Dependencies: 214
-- Data for Name: Candidate; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public."Candidate" (candidate_id, name, polling_order_id) VALUES (2, 'Competent Candidate', 1);
INSERT INTO public."Candidate" (candidate_id, name, polling_order_id) VALUES (12, 'Competent Candidate A', 1);
INSERT INTO public."Candidate" (candidate_id, name, polling_order_id) VALUES (18, 'a Competent Candidate f', 1);
--
-- TOC entry 3391 (class 0 OID 16460)
-- Dependencies: 223
-- Data for Name: ExternalNotes; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public."ExternalNotes" (external_notes_id, candidate_id, polling_order_member_id, external_note, en_created_at) VALUES (6, 2, 1, '3rd External note info for candidate', '2022-09-01 20:00:00');
INSERT INTO public."ExternalNotes" (external_notes_id, candidate_id, polling_order_member_id, external_note, en_created_at) VALUES (7, 2, 1, 'test', '2022-10-22 20:00:00');
INSERT INTO public."ExternalNotes" (external_notes_id, candidate_id, polling_order_member_id, external_note, en_created_at) VALUES (8, 2, 1, 'test2', '2022-10-22 20:00:00');
INSERT INTO public."ExternalNotes" (external_notes_id, candidate_id, polling_order_member_id, external_note, en_created_at) VALUES (9, 2, 1, 'test3', '2022-10-22 20:00:00');
INSERT INTO public."ExternalNotes" (external_notes_id, candidate_id, polling_order_member_id, external_note, en_created_at) VALUES (10, 2, 1, 'test4', '2022-10-22 20:00:00');
INSERT INTO public."ExternalNotes" (external_notes_id, candidate_id, polling_order_member_id, external_note, en_created_at) VALUES (11, 2, 1, 'test5', '2022-10-23 20:00:00');
INSERT INTO public."ExternalNotes" (external_notes_id, candidate_id, polling_order_member_id, external_note, en_created_at) VALUES (12, 2, 17, 'testing as donnan', '2022-10-23 20:00:00');
INSERT INTO public."ExternalNotes" (external_notes_id, candidate_id, polling_order_member_id, external_note, en_created_at) VALUES (13, 18, 1, 'non polling note for a Competent Candidate f', '2022-10-23 20:00:00');
--
-- TOC entry 3380 (class 0 OID 16407)
-- Dependencies: 212
-- Data for Name: Polling; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public."Polling" (polling_id, polling_name, start_date, end_date, polling_order_id) VALUES (11, 'Nov 2022 Polling', '2022-10-21', '2022-10-28', 1);
--
-- TOC entry 3401 (class 0 OID 24758)
-- Dependencies: 233
-- Data for Name: PollingCandidates; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public."PollingCandidates" (polling_id, candidate_id, polling_candidate_id) VALUES (11, 18, 14);
INSERT INTO public."PollingCandidates" (polling_id, candidate_id, polling_candidate_id) VALUES (11, 2, 15);
--
-- TOC entry 3387 (class 0 OID 16428)
-- Dependencies: 219
-- Data for Name: PollingNotes; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public."PollingNotes" (polling_notes_id, note, vote, polling_id, candidate_id, polling_order_id, pn_created_at, polling_order_member_id, completed) VALUES (4, 'polling note', NULL, 11, 2, 1, '2022-10-23 00:46:52.269866', 1, false);
--
-- TOC entry 3393 (class 0 OID 16481)
-- Dependencies: 225
-- Data for Name: PollingOrder; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public."PollingOrder" (polling_order_id, polling_order_name, polling_order_admin, polling_order_admin_assistant) VALUES (1, 'White Scarf', 1, 1);
INSERT INTO public."PollingOrder" (polling_order_id, polling_order_name, polling_order_admin, polling_order_admin_assistant) VALUES (5, 'Scarlet Guard', 63, 63);
--
-- TOC entry 3378 (class 0 OID 16397)
-- Dependencies: 210
-- Data for Name: PollingOrderMember; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public."PollingOrderMember" (polling_order_member_id, name, email, password, polling_order_id, pom_created_at, new_password_token, new_password_token_timestamp, approved) OVERRIDING SYSTEM VALUE VALUES (64, 'New Guy Scarlet Guard', 'some1243555544@some.com', '$2b$10$ak84ggu5Nqm6Zjlz3VWtDeylAY.S24hwGpkiAmFgYN5rK3pLihPKm', 5, '2022-09-01', NULL, NULL, false);
INSERT INTO public."PollingOrderMember" (polling_order_member_id, name, email, password, polling_order_id, pom_created_at, new_password_token, new_password_token_timestamp, approved) OVERRIDING SYSTEM VALUE VALUES (1, 'Markus skalpr Grimsson', 'marcusoshea100@gmail.com', '$2b$10$nC2pHNTOlWEO1xdXI6XPjevP8coT1NIWxoY2WqW/6RpALgoC5PQsW', 1, '2022-08-09', 0, '2022-10-15', true);
INSERT INTO public."PollingOrderMember" (polling_order_member_id, name, email, password, polling_order_id, pom_created_at, new_password_token, new_password_token_timestamp, approved) OVERRIDING SYSTEM VALUE VALUES (63, 'Juan Miguel Cezar', 'testjuan@gmail.com', '$2b$10$WxUM7MS3Cf5LHnEQW4Y4LeorAqE4671LaGu49OP7PYkCpSync0xPS', 5, '2022-10-14', 0, NULL, true);
INSERT INTO public."PollingOrderMember" (polling_order_member_id, name, email, password, polling_order_id, pom_created_at, new_password_token, new_password_token_timestamp, approved) OVERRIDING SYSTEM VALUE VALUES (65, 'Markus skalpr Grimsson', 'marcusoshea100@gmail.com', '$2b$10$H9TBqQJyZ0x542xOsh0OduJiz4R3.9ehPrSM53V86kunXw7Q9JX8y', 5, '2022-10-13', 0, NULL, false);
INSERT INTO public."PollingOrderMember" (polling_order_member_id, name, email, password, polling_order_id, pom_created_at, new_password_token, new_password_token_timestamp, approved) OVERRIDING SYSTEM VALUE VALUES (71, 'ffffffffeeeeeeeeeeeeeee', 'marcusoshea100fffffffffffffff@gmail.com', '$2b$10$WLTpEGB3nWnfFX6id0hdOOAR3iooT4rXlgdDYySRKHUxuVwjVtZqC', 1, '2022-10-16', NULL, NULL, false);
INSERT INTO public."PollingOrderMember" (polling_order_member_id, name, email, password, polling_order_id, pom_created_at, new_password_token, new_password_token_timestamp, approved) OVERRIDING SYSTEM VALUE VALUES (68, 'GGGGGGG', 'marcusoshea100333@gmail.com', '$2b$10$Uh1vmvOzFetPxGg53sDDw.XioQyO7JShHmHT2.r6KSOYhFhc8TMqm', 1, '2022-10-16', 3821996, '2022-10-15', true);
INSERT INTO public."PollingOrderMember" (polling_order_member_id, name, email, password, polling_order_id, pom_created_at, new_password_token, new_password_token_timestamp, approved) OVERRIDING SYSTEM VALUE VALUES (69, 'Some good fencer', 'marcusoshea10340@gmail.com', '$2b$10$vHX3mliv4F7sZ5kivq3xies/0n40Yji9Mnd93I7BDkoaMDNGXq/KO', 1, '2022-10-15', NULL, NULL, false);
INSERT INTO public."PollingOrderMember" (polling_order_member_id, name, email, password, polling_order_id, pom_created_at, new_password_token, new_password_token_timestamp, approved) OVERRIDING SYSTEM VALUE VALUES (70, 'tttt', 'marcusoshea4444444444@gmail.com', '$2b$10$goly2qdVdw31ymXjfR6c1u7DQd74JUVi0pBCxF9nG78bvPBa5j8m.', 1, '2022-10-16', NULL, NULL, false);
INSERT INTO public."PollingOrderMember" (polling_order_member_id, name, email, password, polling_order_id, pom_created_at, new_password_token, new_password_token_timestamp, approved) OVERRIDING SYSTEM VALUE VALUES (17, 'Donnan', 'some@some.com', '$2b$10$2Cyk/t9EihvL0AypsJvmNe8kO07zdKZTO.MsZmKT8JpIDq5QqIBIG', 1, '2022-09-11', NULL, NULL, true);
INSERT INTO public."PollingOrderMember" (polling_order_member_id, name, email, password, polling_order_id, pom_created_at, new_password_token, new_password_token_timestamp, approved) OVERRIDING SYSTEM VALUE VALUES (62, 'Newguy eeeee', 'some1243555544@some.com', '$2b$10$FYkBujKMihsGFbZSaxbmtu..oWapp3vDlgKofriqQU8PVDfBXjxCG', 1, '2022-10-14', NULL, NULL, true);
--
-- TOC entry 3425 (class 0 OID 0)
-- Dependencies: 213
-- Name: Candidate_candidate_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."Candidate_candidate_id_seq"', 18, true);
--
-- TOC entry 3426 (class 0 OID 0)
-- Dependencies: 228
-- Name: Candidate_polling_order_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."Candidate_polling_order_id_seq"', 1, false);
--
-- TOC entry 3427 (class 0 OID 0)
-- Dependencies: 221
-- Name: ExternalNotes_candidate_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."ExternalNotes_candidate_id_seq"', 1, false);
--
-- TOC entry 3428 (class 0 OID 0)
-- Dependencies: 220
-- Name: ExternalNotes_external_notes_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."ExternalNotes_external_notes_id_seq"', 13, true);
--
-- TOC entry 3429 (class 0 OID 0)
-- Dependencies: 222
-- Name: ExternalNotes_ws_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."ExternalNotes_ws_id_seq"', 1, false);
--
-- TOC entry 3430 (class 0 OID 0)
-- Dependencies: 232
-- Name: PollingCandidates_polling_candidate_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."PollingCandidates_polling_candidate_id_seq"', 15, true);
--
-- TOC entry 3431 (class 0 OID 0)
-- Dependencies: 217
-- Name: PollingNotes_candidate_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."PollingNotes_candidate_id_seq"', 1, false);
--
-- TOC entry 3432 (class 0 OID 0)
-- Dependencies: 216
-- Name: PollingNotes_polling_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."PollingNotes_polling_id_seq"', 1, false);
--
-- TOC entry 3433 (class 0 OID 0)
-- Dependencies: 215
-- Name: PollingNotes_polling_notes_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."PollingNotes_polling_notes_id_seq"', 4, true);
--
-- TOC entry 3434 (class 0 OID 0)
-- Dependencies: 218
-- Name: PollingNotes_ws_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."PollingNotes_ws_id_seq"', 1, false);
--
-- TOC entry 3435 (class 0 OID 0)
-- Dependencies: 226
-- Name: PollingOrderMember_polling_order_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."PollingOrderMember_polling_order_id_seq"', 6, true);
--
-- TOC entry 3436 (class 0 OID 0)
-- Dependencies: 231
-- Name: PollingOrderMember_polling_order_member_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."PollingOrderMember_polling_order_member_id_seq"', 71, true);
--
-- TOC entry 3437 (class 0 OID 0)
-- Dependencies: 230
-- Name: PollingOrder_polling_order_admin_assistant_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."PollingOrder_polling_order_admin_assistant_seq"', 1, true);
--
-- TOC entry 3438 (class 0 OID 0)
-- Dependencies: 229
-- Name: PollingOrder_polling_order_admin_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."PollingOrder_polling_order_admin_seq"', 1, false);
--
-- TOC entry 3439 (class 0 OID 0)
-- Dependencies: 224
-- Name: PollingOrder_polling_order_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."PollingOrder_polling_order_id_seq"', 5, true);
--
-- TOC entry 3440 (class 0 OID 0)
-- Dependencies: 211
-- Name: Polling_polling_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."Polling_polling_id_seq"', 11, true);
--
-- TOC entry 3441 (class 0 OID 0)
-- Dependencies: 227
-- Name: Polling_polling_order_member_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."Polling_polling_order_member_id_seq"', 1, false);
--
-- TOC entry 3442 (class 0 OID 0)
-- Dependencies: 209
-- Name: WhiteScarves_ws_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public."WhiteScarves_ws_id_seq"', 6, true);
--
-- TOC entry 3220 (class 2606 OID 16423)
-- Name: Candidate Candidate_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Candidate"
ADD CONSTRAINT "Candidate_pkey" PRIMARY KEY (candidate_id);
--
-- TOC entry 3227 (class 2606 OID 16469)
-- Name: ExternalNotes ExternalNotes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."ExternalNotes"
ADD CONSTRAINT "ExternalNotes_pkey" PRIMARY KEY (external_notes_id);
--
-- TOC entry 3231 (class 2606 OID 24763)
-- Name: PollingCandidates PollingCandidates_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."PollingCandidates"
ADD CONSTRAINT "PollingCandidates_pkey" PRIMARY KEY (polling_candidate_id);
--
-- TOC entry 3222 (class 2606 OID 16438)
-- Name: PollingNotes PollingNotes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."PollingNotes"
ADD CONSTRAINT "PollingNotes_pkey" PRIMARY KEY (polling_notes_id);
--
-- TOC entry 3215 (class 2606 OID 16402)
-- Name: PollingOrderMember PollingOrderMember_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."PollingOrderMember"
ADD CONSTRAINT "PollingOrderMember_pkey" PRIMARY KEY (polling_order_member_id);
--
-- TOC entry 3229 (class 2606 OID 16488)
-- Name: PollingOrder PollingOrder_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."PollingOrder"
ADD CONSTRAINT "PollingOrder_pkey" PRIMARY KEY (polling_order_id);
--
-- TOC entry 3218 (class 2606 OID 16414)
-- Name: Polling Polling_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."Polling"
ADD CONSTRAINT "Polling_pkey" PRIMARY KEY (polling_id);
--
-- TOC entry 3223 (class 1259 OID 16450)
-- Name: fki_candidate_id; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX fki_candidate_id ON public."PollingNotes" USING btree (candidate_id);
--
-- TOC entry 3224 (class 1259 OID 16444)
-- Name: fki_polling_id; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX fki_polling_id ON public."PollingNotes" USING btree (polling_id);
--
-- TOC entry 3216 (class 1259 OID 16502)
-- Name: fki_polling_order_id; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX fki_polling_order_id ON public."PollingOrderMember" USING btree (polling_order_id);
--
-- TOC entry 3225 (class 1259 OID 16456)
-- Name: fki_ws_id; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX fki_ws_id ON public."PollingNotes" USING btree (polling_order_id);
--
-- TOC entry 3235 (class 2606 OID 16445)
-- Name: PollingNotes candidate_id; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public."PollingNotes"
ADD CONSTRAINT candidate_id FOREIGN KEY (candidate_id) REFERENCES public."Candidate"(candidate_id) NOT VALID;