-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.sql
More file actions
1944 lines (1404 loc) · 58.3 KB
/
database.sql
File metadata and controls
1944 lines (1404 loc) · 58.3 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 (Debian 14.5-2.pgdg110+2)
-- Dumped by pg_dump version 14.10 (Ubuntu 14.10-0ubuntu0.22.04.1)
-- Started on 2024-02-02 15:39:18 IST
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 3522 (class 1262 OID 13757)
-- Name: postgres; Type: DATABASE; Schema: -; Owner: postgres
--
CREATE DATABASE postgres WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE = 'en_US.utf8';
ALTER DATABASE postgres OWNER TO postgres;
\connect postgres
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 3523 (class 0 OID 0)
-- Dependencies: 3522
-- Name: DATABASE postgres; Type: COMMENT; Schema: -; Owner: postgres
--
COMMENT ON DATABASE postgres IS 'default administrative connection database';
--
-- TOC entry 3 (class 2615 OID 2200)
-- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
--
CREATE SCHEMA public;
ALTER SCHEMA public OWNER TO postgres;
--
-- TOC entry 3524 (class 0 OID 0)
-- Dependencies: 3
-- Name: SCHEMA public; Type: COMMENT; Schema: -; Owner: postgres
--
COMMENT ON SCHEMA public IS 'standard public schema';
--
-- TOC entry 888 (class 1247 OID 16466)
-- Name: marital_status; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.marital_status AS ENUM (
'S',
'M',
'W',
'A',
'D',
'L',
'U'
);
ALTER TYPE public.marital_status OWNER TO postgres;
--
-- TOC entry 885 (class 1247 OID 16457)
-- Name: sex; Type: TYPE; Schema: public; Owner: postgres
--
CREATE TYPE public.sex AS ENUM (
'male',
'female',
'other',
'unknown'
);
ALTER TYPE public.sex OWNER TO postgres;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- TOC entry 228 (class 1259 OID 16533)
-- Name: address; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.address (
id integer NOT NULL,
address_line1 character varying(100),
address_line2 character varying(100),
locality character varying(50),
sub_region_code character varying(20),
region_code character varying(30),
postal_code character varying(30),
country_code character varying(30),
social_person_id integer
);
ALTER TABLE public.address OWNER TO postgres;
--
-- TOC entry 227 (class 1259 OID 16532)
-- Name: address_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.address_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.address_id_seq OWNER TO postgres;
--
-- TOC entry 3525 (class 0 OID 0)
-- Dependencies: 227
-- Name: address_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.address_id_seq OWNED BY public.address.id;
--
-- TOC entry 239 (class 1259 OID 16630)
-- Name: address_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.address_seq
START WITH 1
INCREMENT BY 50
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.address_seq OWNER TO postgres;
--
-- TOC entry 218 (class 1259 OID 16428)
-- Name: benefit; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.benefit (
id integer NOT NULL,
benefit_type character varying(50),
benefit_date character varying(100),
benefit_value character varying(20),
person_id integer
);
ALTER TABLE public.benefit OWNER TO postgres;
--
-- TOC entry 217 (class 1259 OID 16427)
-- Name: benefit_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.benefit_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.benefit_id_seq OWNER TO postgres;
--
-- TOC entry 3526 (class 0 OID 0)
-- Dependencies: 217
-- Name: benefit_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.benefit_id_seq OWNED BY public.benefit.id;
--
-- TOC entry 240 (class 1259 OID 16631)
-- Name: benefit_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.benefit_seq
START WITH 1
INCREMENT BY 50
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.benefit_seq OWNER TO postgres;
--
-- TOC entry 238 (class 1259 OID 16593)
-- Name: bounds; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.bounds (
id integer NOT NULL,
northeast_id integer,
southwest_id integer,
geometry_id integer
);
ALTER TABLE public.bounds OWNER TO postgres;
--
-- TOC entry 237 (class 1259 OID 16592)
-- Name: bounds_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.bounds_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.bounds_id_seq OWNER TO postgres;
--
-- TOC entry 3527 (class 0 OID 0)
-- Dependencies: 237
-- Name: bounds_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.bounds_id_seq OWNED BY public.bounds.id;
--
-- TOC entry 241 (class 1259 OID 16632)
-- Name: bounds_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.bounds_seq
START WITH 1
INCREMENT BY 50
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.bounds_seq OWNER TO postgres;
--
-- TOC entry 236 (class 1259 OID 16581)
-- Name: geo_coordinate; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.geo_coordinate (
id integer NOT NULL,
latitude double precision,
longitude double precision,
geometry_id integer
);
ALTER TABLE public.geo_coordinate OWNER TO postgres;
--
-- TOC entry 235 (class 1259 OID 16580)
-- Name: geo_coordinate_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.geo_coordinate_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.geo_coordinate_id_seq OWNER TO postgres;
--
-- TOC entry 3528 (class 0 OID 0)
-- Dependencies: 235
-- Name: geo_coordinate_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.geo_coordinate_id_seq OWNED BY public.geo_coordinate.id;
--
-- TOC entry 242 (class 1259 OID 16633)
-- Name: geo_coordinate_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.geo_coordinate_seq
START WITH 1
INCREMENT BY 50
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.geo_coordinate_seq OWNER TO postgres;
--
-- TOC entry 230 (class 1259 OID 16545)
-- Name: geo_location; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.geo_location (
id integer NOT NULL,
address_id integer
);
ALTER TABLE public.geo_location OWNER TO postgres;
--
-- TOC entry 229 (class 1259 OID 16544)
-- Name: geo_location_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.geo_location_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.geo_location_id_seq OWNER TO postgres;
--
-- TOC entry 3529 (class 0 OID 0)
-- Dependencies: 229
-- Name: geo_location_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.geo_location_id_seq OWNED BY public.geo_location.id;
--
-- TOC entry 243 (class 1259 OID 16634)
-- Name: geo_location_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.geo_location_seq
START WITH 1
INCREMENT BY 50
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.geo_location_seq OWNER TO postgres;
--
-- TOC entry 234 (class 1259 OID 16569)
-- Name: geometry; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.geometry (
id integer NOT NULL,
plus_code_id integer
);
ALTER TABLE public.geometry OWNER TO postgres;
--
-- TOC entry 233 (class 1259 OID 16568)
-- Name: geometry_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.geometry_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.geometry_id_seq OWNER TO postgres;
--
-- TOC entry 3530 (class 0 OID 0)
-- Dependencies: 233
-- Name: geometry_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.geometry_id_seq OWNED BY public.geometry.id;
--
-- TOC entry 244 (class 1259 OID 16635)
-- Name: geometry_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.geometry_seq
START WITH 1
INCREMENT BY 50
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.geometry_seq OWNER TO postgres;
--
-- TOC entry 212 (class 1259 OID 16392)
-- Name: identifier; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.identifier (
id integer NOT NULL,
identifier_type character varying(50),
identifier_value character varying(50),
person_id integer
);
ALTER TABLE public.identifier OWNER TO postgres;
--
-- TOC entry 214 (class 1259 OID 16404)
-- Name: names; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.names (
id integer NOT NULL,
surname character varying(50),
given_name character varying(50),
second_name character varying(50),
maiden_name character varying(50),
prefix character varying(10),
suffix character varying(10),
person_id integer
);
ALTER TABLE public.names OWNER TO postgres;
--
-- TOC entry 220 (class 1259 OID 16440)
-- Name: payroll; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.payroll (
id integer NOT NULL,
payroll_amount character varying(20),
payment_credit_date character varying(30),
payment_credit_amount character varying(20),
payment_charges character varying(20),
payment_status character varying(10),
person_id integer
);
ALTER TABLE public.payroll OWNER TO postgres;
--
-- TOC entry 210 (class 1259 OID 16385)
-- Name: person; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.person (
id integer NOT NULL,
household_status character varying(50),
benefiting_entity character varying(50),
sex character varying(10),
birth_date character varying(30),
sub_region_code character varying(20),
marital_status character varying(10),
poverty_score numeric(50,0),
is_disabled character varying(20),
household_identifier character varying(50)
);
ALTER TABLE public.person OWNER TO postgres;
--
-- TOC entry 216 (class 1259 OID 16416)
-- Name: programme; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.programme (
id integer NOT NULL,
programme_name character varying(50),
programme_identifier character varying(50),
registration_date character varying(30),
enrolment_date character varying(30),
suspension_date character varying(30),
graduation_date character varying(30),
enrolment_status character varying(10),
person_id integer
);
ALTER TABLE public.programme OWNER TO postgres;
--
-- TOC entry 221 (class 1259 OID 16451)
-- Name: ibr_person_view; Type: VIEW; Schema: public; Owner: postgres
--
CREATE VIEW public.ibr_person_view AS
SELECT p.id,
p.household_status,
p.benefiting_entity,
p.sex,
p.birth_date,
p.sub_region_code,
p.marital_status,
p.poverty_score,
p.is_disabled,
p.household_identifier,
i.identifier_type,
i.identifier_value,
n.surname,
n.given_name,
n.second_name,
n.maiden_name,
n.prefix,
n.suffix,
pr.programme_name,
pr.programme_identifier,
pr.registration_date,
pr.enrolment_date,
pr.suspension_date,
pr.graduation_date,
pr.enrolment_status,
b.benefit_type,
b.benefit_date,
b.benefit_value,
py.payroll_amount,
py.payment_credit_date,
py.payment_credit_amount,
py.payment_charges,
py.payment_status
FROM (((((public.person p
LEFT JOIN public.identifier i ON ((p.id = i.person_id)))
LEFT JOIN public.names n ON ((p.id = n.person_id)))
LEFT JOIN public.programme pr ON ((p.id = pr.person_id)))
LEFT JOIN public.benefit b ON ((p.id = b.person_id)))
LEFT JOIN public.payroll py ON ((p.id = py.person_id)));
ALTER TABLE public.ibr_person_view OWNER TO postgres;
--
-- TOC entry 253 (class 1259 OID 24576)
-- Name: ibr_person_view_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.ibr_person_view_seq
START WITH 1
INCREMENT BY 50
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.ibr_person_view_seq OWNER TO postgres;
--
-- TOC entry 211 (class 1259 OID 16391)
-- Name: identifier_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.identifier_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.identifier_id_seq OWNER TO postgres;
--
-- TOC entry 3531 (class 0 OID 0)
-- Dependencies: 211
-- Name: identifier_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.identifier_id_seq OWNED BY public.identifier.id;
--
-- TOC entry 245 (class 1259 OID 16636)
-- Name: identifier_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.identifier_seq
START WITH 1
INCREMENT BY 50
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.identifier_seq OWNER TO postgres;
--
-- TOC entry 213 (class 1259 OID 16403)
-- Name: names_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.names_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.names_id_seq OWNER TO postgres;
--
-- TOC entry 3532 (class 0 OID 0)
-- Dependencies: 213
-- Name: names_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.names_id_seq OWNED BY public.names.id;
--
-- TOC entry 246 (class 1259 OID 16637)
-- Name: names_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.names_seq
START WITH 1
INCREMENT BY 50
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.names_seq OWNER TO postgres;
--
-- TOC entry 219 (class 1259 OID 16439)
-- Name: payroll_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.payroll_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.payroll_id_seq OWNER TO postgres;
--
-- TOC entry 3533 (class 0 OID 0)
-- Dependencies: 219
-- Name: payroll_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.payroll_id_seq OWNED BY public.payroll.id;
--
-- TOC entry 247 (class 1259 OID 16638)
-- Name: payroll_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.payroll_seq
START WITH 1
INCREMENT BY 50
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.payroll_seq OWNER TO postgres;
--
-- TOC entry 209 (class 1259 OID 16384)
-- Name: person_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.person_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.person_id_seq OWNER TO postgres;
--
-- TOC entry 3534 (class 0 OID 0)
-- Dependencies: 209
-- Name: person_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.person_id_seq OWNED BY public.person.id;
--
-- TOC entry 248 (class 1259 OID 16639)
-- Name: person_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.person_seq
START WITH 1
INCREMENT BY 50
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.person_seq OWNER TO postgres;
--
-- TOC entry 249 (class 1259 OID 16640)
-- Name: person_view_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.person_view_seq
START WITH 1
INCREMENT BY 50
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.person_view_seq OWNER TO postgres;
--
-- TOC entry 232 (class 1259 OID 16557)
-- Name: plus_code; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.plus_code (
id integer NOT NULL,
global_code character varying(100),
geo_location_id integer
);
ALTER TABLE public.plus_code OWNER TO postgres;
--
-- TOC entry 231 (class 1259 OID 16556)
-- Name: plus_code_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.plus_code_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.plus_code_id_seq OWNER TO postgres;
--
-- TOC entry 3535 (class 0 OID 0)
-- Dependencies: 231
-- Name: plus_code_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.plus_code_id_seq OWNED BY public.plus_code.id;
--
-- TOC entry 250 (class 1259 OID 16641)
-- Name: plus_code_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.plus_code_seq
START WITH 1
INCREMENT BY 50
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.plus_code_seq OWNER TO postgres;
--
-- TOC entry 215 (class 1259 OID 16415)
-- Name: programme_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.programme_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.programme_id_seq OWNER TO postgres;
--
-- TOC entry 3536 (class 0 OID 0)
-- Dependencies: 215
-- Name: programme_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.programme_id_seq OWNED BY public.programme.id;
--
-- TOC entry 251 (class 1259 OID 16642)
-- Name: programme_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.programme_seq
START WITH 1
INCREMENT BY 50
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.programme_seq OWNER TO postgres;
--
-- TOC entry 226 (class 1259 OID 16521)
-- Name: social_names; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.social_names (
id integer NOT NULL,
surname character varying(50),
given_name character varying(50),
second_name character varying(50),
maiden_name character varying(50),
prefix character varying(10),
suffix character varying(10),
social_person_id integer,
person_id integer
);
ALTER TABLE public.social_names OWNER TO postgres;
--
-- TOC entry 225 (class 1259 OID 16520)
-- Name: social_names_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.social_names_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.social_names_id_seq OWNER TO postgres;
--
-- TOC entry 3537 (class 0 OID 0)
-- Dependencies: 225
-- Name: social_names_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.social_names_id_seq OWNED BY public.social_names.id;
--
-- TOC entry 252 (class 1259 OID 16643)
-- Name: social_names_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.social_names_seq
START WITH 1
INCREMENT BY 50
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.social_names_seq OWNER TO postgres;
--
-- TOC entry 223 (class 1259 OID 16482)
-- Name: social_person; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.social_person (
id integer NOT NULL,
sex public.sex NOT NULL,
birth_date character varying(30) NOT NULL,
marital_status public.marital_status,
is_disabled character varying(20),
disability_identifier_id integer,
disability_type character varying(100)[],
functional_limitation_type character varying(100)[],
functional_severity character varying(100)[],
nationality character varying(100)[],
employment_status character varying(30),
is_deceased character varying(30),
death_date character varying(30),
ethnicity character varying(100)[],
phone_number character varying(100)[],
email character varying(200)[],
household_identifier character varying(50) NOT NULL,
household_status character varying(30),
parent1_identifier_id integer,
parent2_identifier_id integer,
registration_date character varying(30) NOT NULL,
last_updated character varying(30),
household_size integer DEFAULT 5,
poverty_score integer
);
ALTER TABLE public.social_person OWNER TO postgres;
--
-- TOC entry 222 (class 1259 OID 16481)
-- Name: social_person_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.social_person_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.social_person_id_seq OWNER TO postgres;
--
-- TOC entry 3538 (class 0 OID 0)
-- Dependencies: 222
-- Name: social_person_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.social_person_id_seq OWNED BY public.social_person.id;
--
-- TOC entry 224 (class 1259 OID 16505)
-- Name: social_person_identifier; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.social_person_identifier (
social_person_id integer NOT NULL,
identifier_id integer NOT NULL
);
ALTER TABLE public.social_person_identifier OWNER TO postgres;
--