-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stack360-data.sql
27982 lines (18363 loc) · 900 KB
/
stack360-data.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
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 15.4
-- Dumped by pg_dump version 15.4
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: address; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.address (
address_id character(16) NOT NULL,
street character varying(60),
city character varying(60),
state character varying(25),
zip character varying(10),
person_join character(16),
org_group_join character(16),
address_type integer NOT NULL,
street2 character varying(60),
country_code character(2) DEFAULT 'US'::bpchar NOT NULL,
county character varying(30),
record_type character(1) DEFAULT 'R'::bpchar NOT NULL,
time_zone_offset smallint DEFAULT 100 NOT NULL,
CONSTRAINT address_record_type_chk CHECK (((record_type = 'R'::bpchar) OR (record_type = 'C'::bpchar)))
);
ALTER TABLE public.address OWNER TO postgres;
--
-- Name: TABLE address; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON TABLE public.address IS 'Address table can be linked to companies, people, etc.. It should be used to store all addresses in the system.';
--
-- Name: COLUMN address.address_id; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.address.address_id IS 'Primary key';
--
-- Name: COLUMN address.street; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.address.street IS 'Street address';
--
-- Name: COLUMN address.city; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.address.city IS 'The city';
--
-- Name: COLUMN address.state; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.address.state IS 'Two character state abbreviation or four character foreign local, or province';
--
-- Name: COLUMN address.zip; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.address.zip IS 'Zip+4 code';
--
-- Name: COLUMN address.person_join; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.address.person_join IS 'Join to person table';
--
-- Name: COLUMN address.org_group_join; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.address.org_group_join IS 'Join to org_group table';
--
-- Name: COLUMN address.address_type; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.address.address_type IS 'Address type
1=work
2=home
3=P.O. Box';
--
-- Name: COLUMN address.country_code; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.address.country_code IS 'Codes from http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm';
--
-- Name: COLUMN address.record_type; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.address.record_type IS 'R = Real record
C = Change request';
--
-- Name: COLUMN address.time_zone_offset; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.address.time_zone_offset IS 'Offset from UTC. 100 means unknown.';
--
-- Name: address_cr; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.address_cr (
change_request_id character(16) NOT NULL,
real_record_id character(16),
change_status character(1) NOT NULL,
request_time timestamp with time zone NOT NULL,
change_record_id character(16) NOT NULL,
requestor_id character(16) NOT NULL,
approver_id character(16),
approval_time timestamp with time zone,
project_id character(16) NOT NULL,
CONSTRAINT address_rcr_status_chk CHECK (((change_status = 'P'::bpchar) OR (change_status = 'A'::bpchar) OR (change_status = 'R'::bpchar)))
);
ALTER TABLE public.address_cr OWNER TO postgres;
--
-- Name: TABLE address_cr; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON TABLE public.address_cr IS 'Holds record change requests for the address table.';
--
-- Name: COLUMN address_cr.change_status; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.address_cr.change_status IS 'P = Pending request
A = Approved
R = Rejected';
--
-- Name: agency; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.agency (
agency_id character(16) NOT NULL,
agency_external_id character varying(20)
);
ALTER TABLE public.agency OWNER TO postgres;
--
-- Name: agency_join; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.agency_join (
agency_join_id character(16) NOT NULL,
agency_id character(16) NOT NULL,
company_id character(16) NOT NULL
);
ALTER TABLE public.agency_join OWNER TO postgres;
--
-- Name: agent; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.agent (
agent_id character(16) NOT NULL,
ext_ref character varying(11)
);
ALTER TABLE public.agent OWNER TO postgres;
--
-- Name: agent_join; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.agent_join (
agent_join_id character(16) NOT NULL,
agent_id character(16) NOT NULL,
company_id character(16) NOT NULL,
approved character(1) DEFAULT 'N'::bpchar NOT NULL,
approved_by_person_id character(16),
approved_date timestamp with time zone,
CONSTRAINT agent_join_app_chk CHECK (((approved = 'Y'::bpchar) OR (approved = 'N'::bpchar)))
);
ALTER TABLE public.agent_join OWNER TO postgres;
--
-- Name: agreement_form; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.agreement_form (
agreement_form_id character(16) NOT NULL,
form_date timestamp with time zone NOT NULL,
description character varying(60) NOT NULL,
summary character varying(255),
file_name_ext character varying(10) NOT NULL,
expiration_date integer DEFAULT 0 NOT NULL,
form bytea NOT NULL
);
ALTER TABLE public.agreement_form OWNER TO postgres;
--
-- Name: COLUMN agreement_form.form_date; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.agreement_form.form_date IS 'When the form was added';
--
-- Name: COLUMN agreement_form.file_name_ext; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.agreement_form.file_name_ext IS 'This tells us what type of form it is.';
--
-- Name: COLUMN agreement_form.expiration_date; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.agreement_form.expiration_date IS 'The form is no longer valad AFTER this date';
--
-- Name: agreement_person_join; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.agreement_person_join (
agreement_person_join_id character(16) NOT NULL,
person_id character(16) NOT NULL,
agreement_form_id character(16) NOT NULL,
agreement_time timestamp with time zone NOT NULL
);
ALTER TABLE public.agreement_person_join OWNER TO postgres;
--
-- Name: alert; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.alert (
alert_id character(16) NOT NULL,
alert_distribution smallint NOT NULL,
start_date integer NOT NULL,
last_date integer NOT NULL,
alert_short character varying(2000),
alert_long text,
org_group_id character(16),
person_id character(16),
last_change_person_id character(16) NOT NULL,
last_chage_datetime timestamp with time zone NOT NULL,
CONSTRAINT alert_dist_chk CHECK (((alert_distribution >= 1) AND (alert_distribution <= 6))),
CONSTRAINT alert_last_date_chk CHECK ((last_date > 0)),
CONSTRAINT alert_start_date_chk CHECK ((start_date > 0))
);
ALTER TABLE public.alert OWNER TO postgres;
--
-- Name: COLUMN alert.alert_distribution; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.alert.alert_distribution IS '1 = to all employees of a company
2 = particular employees in a company
3 = to all employees of a company (from agent)
4 = to all members of an agent''s company
5 = to all agents
6 = all company main contacts';
--
-- Name: COLUMN alert.last_change_person_id; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.alert.last_change_person_id IS 'This is the person who last changed this record.';
--
-- Name: COLUMN alert.last_chage_datetime; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.alert.last_chage_datetime IS 'This is the date and time this record was last changed.';
--
-- Name: alert_person_join; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.alert_person_join (
alert_id character(16) NOT NULL,
person_id character(16) NOT NULL
);
ALTER TABLE public.alert_person_join OWNER TO postgres;
--
-- Name: applicant; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.applicant (
person_id character(16) NOT NULL,
applicant_source_id character(16) NOT NULL,
applicant_status_id character(16) NOT NULL,
first_aware_date integer DEFAULT 0 NOT NULL,
comments character varying(2000),
eeo_race_id character(16),
date_available integer DEFAULT 0 NOT NULL,
desired_salary integer DEFAULT 0 NOT NULL,
referred_by character varying(40),
years_experience smallint,
day_shift character(1),
night_shift character(1),
veteran character(1),
signature character varying(40),
when_signed timestamp with time zone,
travel_personal character(1) DEFAULT 'N'::bpchar NOT NULL,
travel_friend character(1) DEFAULT 'N'::bpchar NOT NULL,
travel_public character(1) DEFAULT 'N'::bpchar NOT NULL,
travel_unknown character(1) DEFAULT 'N'::bpchar NOT NULL,
agrees character(1) DEFAULT 'N'::bpchar NOT NULL,
agreement_name character varying(50),
agreement_date timestamp with time zone,
background_check_authorized character(1) DEFAULT 'N'::bpchar NOT NULL,
CONSTRAINT applacant_travel_unknown_chk CHECK (((travel_unknown = 'Y'::bpchar) OR (travel_unknown = 'N'::bpchar))),
CONSTRAINT applicant_agrees_chk CHECK (((agrees = 'Y'::bpchar) OR (agrees = 'N'::bpchar))),
CONSTRAINT applicant_background_chk CHECK (((background_check_authorized = 'Y'::bpchar) OR (background_check_authorized = 'N'::bpchar))),
CONSTRAINT applicant_travel_friend_chk CHECK (((travel_friend = 'Y'::bpchar) OR (travel_friend = 'N'::bpchar))),
CONSTRAINT applicant_travel_personal_chk CHECK (((travel_personal = 'Y'::bpchar) OR (travel_personal = 'N'::bpchar))),
CONSTRAINT applicant_travel_public_chk CHECK (((travel_public = 'Y'::bpchar) OR (travel_public = 'N'::bpchar)))
);
ALTER TABLE public.applicant OWNER TO postgres;
--
-- Name: COLUMN applicant.date_available; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant.date_available IS 'YYYYMMDD';
--
-- Name: COLUMN applicant.background_check_authorized; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant.background_check_authorized IS 'Did the applicant authorize a background check?';
--
-- Name: applicant_answer; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.applicant_answer (
applicant_answer_id character(16) NOT NULL,
person_id character(16) NOT NULL,
applicant_question_id character(16) NOT NULL,
string_answer character varying(2000),
date_answer integer,
numeric_answer double precision,
applicant_question_choice_id character(16)
);
ALTER TABLE public.applicant_answer OWNER TO postgres;
--
-- Name: applicant_app_status; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.applicant_app_status (
applicant_app_status_id character(16) NOT NULL,
status_order smallint NOT NULL,
status_name character varying(40) NOT NULL,
last_active_date integer DEFAULT 0 NOT NULL,
is_active character(1) DEFAULT 'Y'::bpchar,
company_id character(16),
phase smallint DEFAULT 0 NOT NULL,
CONSTRAINT applicant_app_status_is_active_chk CHECK (((is_active = 'Y'::bpchar) OR (is_active = 'N'::bpchar)))
);
ALTER TABLE public.applicant_app_status OWNER TO postgres;
--
-- Name: COLUMN applicant_app_status.last_active_date; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_app_status.last_active_date IS 'Last date this record should be used in a new association. 0 means no end.';
--
-- Name: COLUMN applicant_app_status.is_active; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_app_status.is_active IS 'Is this a status that indicates an applicant that is still ellegable for hire nor or possibly sometime in the furture?';
--
-- Name: COLUMN applicant_app_status.company_id; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_app_status.company_id IS 'Company this record is associated with. NULL means all companies.';
--
-- Name: COLUMN applicant_app_status.phase; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_app_status.phase IS '0 = no application
1 = application made
2 = offer extended
3 = offer accepted
4 = hired
5 = offer rejected
6 = offer retracted';
--
-- Name: applicant_application; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.applicant_application (
applicant_application_id character(16) NOT NULL,
person_id character(16) NOT NULL,
applicant_position_id character(16),
application_date integer DEFAULT 0 NOT NULL,
applicant_app_status_id character(16) NOT NULL,
offer_first_generated timestamp with time zone,
offer_last_generated timestamp with time zone,
offer_first_emailed timestamp with time zone,
offer_last_emailed timestamp with time zone,
offer_elec_signed_date timestamp with time zone,
offer_elec_signed_ip character varying(15),
pay_rate real,
position_id character(16) NOT NULL,
phase smallint DEFAULT 0 NOT NULL,
offer_declined_date timestamp with time zone,
offer_retracted_date timestamp with time zone,
offer_last_viewed_date timestamp with time zone
);
ALTER TABLE public.applicant_application OWNER TO postgres;
--
-- Name: COLUMN applicant_application.applicant_position_id; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_application.applicant_position_id IS 'If applying for an actual position being offered';
--
-- Name: COLUMN applicant_application.position_id; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_application.position_id IS 'Their HR position ID. Irrespective of the job they have applied to, this field indicates what we are sloting them for.';
--
-- Name: COLUMN applicant_application.phase; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_application.phase IS '0 = no application
1 = application made
2 = offer extended
3 = offer accepted
4 = hired
5 = offer rejected
6 = offer retracted';
--
-- Name: COLUMN applicant_application.offer_last_viewed_date; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_application.offer_last_viewed_date IS 'This is when the offer was viewed through the applicant interface. We are not tracking if they viewed an offer made via email.';
--
-- Name: applicant_contact; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.applicant_contact (
applicant_contact_id character(16) NOT NULL,
person_id character(16) NOT NULL,
applicant_application_id character(16),
contact_date integer DEFAULT 0 NOT NULL,
contact_time integer DEFAULT 0 NOT NULL,
contact_mode character(1) NOT NULL,
contact_status character(1) NOT NULL,
description character varying(2000) NOT NULL,
who_added character(16) NOT NULL,
CONSTRAINT applicant_contact_contact_mode_chk CHECK (((contact_mode = 'P'::bpchar) OR (contact_mode = 'E'::bpchar) OR (contact_mode = 'F'::bpchar) OR (contact_mode = 'M'::bpchar) OR (contact_mode = 'C'::bpchar) OR (contact_mode = 'R'::bpchar) OR (contact_mode = 'G'::bpchar))),
CONSTRAINT applicant_contact_contact_status_chk CHECK (((contact_status = 'S'::bpchar) OR (contact_status = 'A'::bpchar) OR (contact_status = 'C'::bpchar) OR (contact_status = 'N'::bpchar) OR (contact_status = 'L'::bpchar) OR (contact_status = 'O'::bpchar)))
);
ALTER TABLE public.applicant_contact OWNER TO postgres;
--
-- Name: COLUMN applicant_contact.contact_mode; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_contact.contact_mode IS 'Phone
Email
Fax
Mail
Company Site
Remote Location
General';
--
-- Name: COLUMN applicant_contact.contact_status; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_contact.contact_status IS 'appointment Set
Applicant cancelled or rescheduled
Company cancelled or rescheduled
No show
Late
On time';
--
-- Name: applicant_position; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.applicant_position (
applicant_position_id character(16) NOT NULL,
job_title character varying(80) NOT NULL,
accept_applicant_date integer DEFAULT 0 NOT NULL,
job_start_date integer DEFAULT 0 NOT NULL,
org_group_id character(16) NOT NULL,
position_status character(1) NOT NULL,
ext_ref character varying(15),
position_id character(16) NOT NULL,
CONSTRAINT applicant_position_position_status_chk CHECK (((position_status = 'N'::bpchar) OR (position_status = 'A'::bpchar) OR (position_status = 'S'::bpchar) OR (position_status = 'F'::bpchar) OR (position_status = 'C'::bpchar)))
);
ALTER TABLE public.applicant_position OWNER TO postgres;
--
-- Name: TABLE applicant_position; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON TABLE public.applicant_position IS 'This table holds the open jobs that people can apply for.';
--
-- Name: COLUMN applicant_position.position_status; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_position.position_status IS 'New
Accepting applicants
Suspended
Filled
Cancelled';
--
-- Name: COLUMN applicant_position.ext_ref; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_position.ext_ref IS 'This is the company''s job ID';
--
-- Name: COLUMN applicant_position.position_id; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_position.position_id IS 'This is the position the ad is for.';
--
-- Name: applicant_question; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.applicant_question (
applicant_question_id character(16) NOT NULL,
question_order smallint NOT NULL,
question character varying(80) NOT NULL,
last_active_date integer DEFAULT 0 NOT NULL,
data_type character(1) DEFAULT 'S'::bpchar NOT NULL,
internal_use character(1) DEFAULT 'N'::bpchar NOT NULL,
company_id character(16),
position_id character(16),
CONSTRAINT app_ques_intern_use_chk CHECK (((internal_use = 'Y'::bpchar) OR (internal_use = 'N'::bpchar))),
CONSTRAINT applicant_ques_data_chk CHECK (((data_type = 'N'::bpchar) OR (data_type = 'D'::bpchar) OR (data_type = 'S'::bpchar) OR (data_type = 'Y'::bpchar) OR (data_type = 'L'::bpchar)))
);
ALTER TABLE public.applicant_question OWNER TO postgres;
--
-- Name: COLUMN applicant_question.last_active_date; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_question.last_active_date IS 'Last date this record can be used in a new association. 0 means no end.';
--
-- Name: COLUMN applicant_question.data_type; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_question.data_type IS 'Numeric (double)
Date (YYYYMMDD)
String
Yes/no/unknown (Yes/No/Unknown in field)
List of choices (applicant_question_choice table)';
--
-- Name: COLUMN applicant_question.internal_use; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_question.internal_use IS 'If ''Y'' question used internally or on custom screen, not in stanbdard question dropdowns';
--
-- Name: COLUMN applicant_question.company_id; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_question.company_id IS 'Company this record is associated with. NULL means all companies.';
--
-- Name: applicant_question_choice; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.applicant_question_choice (
applicant_question_choice_id character(16) NOT NULL,
applicant_question_id character(16) NOT NULL,
description character varying(60) NOT NULL
);
ALTER TABLE public.applicant_question_choice OWNER TO postgres;
--
-- Name: applicant_source; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.applicant_source (
applicant_source_id character(16) NOT NULL,
description character varying(40) NOT NULL,
last_active_date integer DEFAULT 0 NOT NULL,
company_id character(16)
);
ALTER TABLE public.applicant_source OWNER TO postgres;
--
-- Name: COLUMN applicant_source.last_active_date; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_source.last_active_date IS 'Last date this record should be used in a new association. 0 means no end.';
--
-- Name: COLUMN applicant_source.company_id; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_source.company_id IS 'Company this record is associated with. NULL means all companies.';
--
-- Name: applicant_status; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.applicant_status (
applicant_status_id character(16) NOT NULL,
status_order smallint NOT NULL,
name character varying(40) NOT NULL,
last_active_date integer DEFAULT 0 NOT NULL,
consider_for_hire character(1) NOT NULL,
send_email character(1) DEFAULT 'N'::bpchar NOT NULL,
email_source character varying(50),
email_text text,
email_subject character varying(100),
company_id character(16),
CONSTRAINT applicant_status_consider_for_hire_chk CHECK (((consider_for_hire = 'Y'::bpchar) OR (consider_for_hire = 'N'::bpchar))),
CONSTRAINT applicant_status_email_chk CHECK (((send_email = 'N'::bpchar) OR ((send_email = 'Y'::bpchar) AND (email_source IS NOT NULL))))
);
ALTER TABLE public.applicant_status OWNER TO postgres;
--
-- Name: COLUMN applicant_status.last_active_date; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_status.last_active_date IS 'Last date this record should be used in a new association. 0 means no end.';
--
-- Name: COLUMN applicant_status.consider_for_hire; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_status.consider_for_hire IS 'Yes
No';
--
-- Name: COLUMN applicant_status.company_id; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.applicant_status.company_id IS 'Company this record is associated with. NULL means all companies.';
--
-- Name: appointment; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.appointment (
appointment_id character(16) NOT NULL,
org_group_id character(16) NOT NULL,
meeting_date integer NOT NULL,
meeting_time integer NOT NULL,
meeting_time_type character(1),
attendees character varying(500),
meeting_location character varying(500),
status character(1) NOT NULL,
purpose character varying(2000) NOT NULL,
location_id character(16),
meeting_length smallint NOT NULL,
CONSTRAINT prospect_appt_status_chk CHECK (((status = 'A'::bpchar) OR (status = 'C'::bpchar) OR (status = 'D'::bpchar))),
CONSTRAINT prospect_appt_time_type_chk CHECK (((meeting_time_type = 'P'::bpchar) OR (meeting_time_type = 'A'::bpchar)))
);
ALTER TABLE public.appointment OWNER TO postgres;
--
-- Name: COLUMN appointment.meeting_time_type; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.appointment.meeting_time_type IS 'P = at specified date and time
A = arrange after specified date and time';
--
-- Name: COLUMN appointment.attendees; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.appointment.attendees IS 'Attendee list';
--
-- Name: COLUMN appointment.meeting_location; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.appointment.meeting_location IS 'Location of meeting';
--
-- Name: COLUMN appointment.status; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.appointment.status IS 'A = Active
C = Cancelled
D = Done / complete';
--
-- Name: COLUMN appointment.purpose; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.appointment.purpose IS 'Purpose of meeting or callback';
--
-- Name: COLUMN appointment.meeting_length; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.appointment.meeting_length IS 'Estimated length of meeting in minutes';
--
-- Name: appointment_location; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.appointment_location (
location_id character(16) NOT NULL,
code character varying(12) NOT NULL,
description character varying(120) NOT NULL,
last_active_date integer DEFAULT 0 NOT NULL,
company_id character(16)
);
ALTER TABLE public.appointment_location OWNER TO postgres;
--
-- Name: TABLE appointment_location; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON TABLE public.appointment_location IS 'Appointment locations can be specific like "Board Room #3" or general like "Client''s Office"';
--
-- Name: COLUMN appointment_location.last_active_date; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.appointment_location.last_active_date IS 'Last date this record can be used in a new association. 0 means no end.';
--
-- Name: COLUMN appointment_location.company_id; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.appointment_location.company_id IS 'Company this record is associated with. NULL means all companies.';
--
-- Name: appointment_person_join; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.appointment_person_join (
join_id character(16) NOT NULL,
appointment_id character(16) NOT NULL,
person_id character(16) NOT NULL,
primary_person character(1) NOT NULL,
CONSTRAINT prospect_appt_primary_emp_chk CHECK (((primary_person = 'Y'::bpchar) OR (primary_person = 'N'::bpchar)))
);
ALTER TABLE public.appointment_person_join OWNER TO postgres;
--
-- Name: COLUMN appointment_person_join.primary_person; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.appointment_person_join.primary_person IS 'Is this the primary employee archestrating the meeting?';
--
-- Name: assembly_template; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.assembly_template (
assembly_template_id character(16) NOT NULL,
assembly_name character varying(80) NOT NULL,
description character varying(256)
);
ALTER TABLE public.assembly_template OWNER TO postgres;
--
-- Name: assembly_template_detail; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.assembly_template_detail (
assembly_template_detail_id character(16) NOT NULL,
assembly_template_id character(16),
parent_detail_id character(16),
product_id character(16) NOT NULL,
quantity integer NOT NULL,
item_particulars character varying(256),
track_to_item character(1) NOT NULL,
CONSTRAINT assem_temp_pointer_chk CHECK ((((parent_detail_id IS NOT NULL) AND (assembly_template_id IS NULL)) OR ((parent_detail_id IS NULL) AND (assembly_template_id IS NOT NULL)))),
CONSTRAINT assembly_template_track_check CHECK (((track_to_item = 'Y'::bpchar) OR (track_to_item = 'N'::bpchar)))
);
ALTER TABLE public.assembly_template_detail OWNER TO postgres;
--
-- Name: COLUMN assembly_template_detail.assembly_template_id; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.assembly_template_detail.assembly_template_id IS 'Use this when it is not in some other part';
--
-- Name: COLUMN assembly_template_detail.parent_detail_id; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.assembly_template_detail.parent_detail_id IS 'Use this when it is inside some other part';
--
-- Name: COLUMN assembly_template_detail.track_to_item; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.assembly_template_detail.track_to_item IS 'Y = Track to individual items
N = Track as a group (quantity)
';
--
-- Name: CONSTRAINT assem_temp_pointer_chk ON assembly_template_detail; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON CONSTRAINT assem_temp_pointer_chk ON public.assembly_template_detail IS 'Make sure only one of the pointer is used.';
--
-- Name: authenticated_senders; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.authenticated_senders (
auth_send_id character(16) NOT NULL,
address_type character(1) NOT NULL,
address character varying(50) NOT NULL,
CONSTRAINT auth_send_type_chk CHECK (((address_type = 'D'::bpchar) OR (address_type = 'E'::bpchar)))
);
ALTER TABLE public.authenticated_senders OWNER TO postgres;
--
-- Name: TABLE authenticated_senders; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON TABLE public.authenticated_senders IS 'Domains or email addresses that are authenticated to send over email. Note that this does not authenticate them. This merely indicates what addresses are authenticated.';
--
-- Name: COLUMN authenticated_senders.address_type; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.authenticated_senders.address_type IS '(D)omain or (E)mail address';
--
-- Name: bank_account; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.bank_account (
bank_account_id character(16) NOT NULL,
org_group_id character(16) NOT NULL,
bank_id character varying(10) NOT NULL,
bank_name character varying(30) NOT NULL,
bank_route character(9) NOT NULL,
bank_account character varying(14) NOT NULL,
account_type character(1) NOT NULL,
last_active_date integer DEFAULT 0 NOT NULL,
CONSTRAINT bank_account_type_chk CHECK (((account_type = 'S'::bpchar) OR (account_type = 'C'::bpchar)))
);
ALTER TABLE public.bank_account OWNER TO postgres;
--
-- Name: COLUMN bank_account.org_group_id; Type: COMMENT; Schema: public; Owner: postgres
--
COMMENT ON COLUMN public.bank_account.org_group_id IS 'What company or org group this account is associated with.';
--
-- Name: COLUMN bank_account.bank_id; Type: COMMENT; Schema: public; Owner: postgres
--