-
Notifications
You must be signed in to change notification settings - Fork 846
/
entire_db.sql
11591 lines (8416 loc) · 454 KB
/
entire_db.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
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 12.14 (Ubuntu 12.14-0ubuntu0.20.04.1)
-- Dumped by pg_dump version 12.14 (Ubuntu 12.14-0ubuntu0.20.04.1)
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;
--
-- Name: augur_data; Type: SCHEMA; Schema: -; Owner: augur
--
CREATE SCHEMA augur_data;
ALTER SCHEMA augur_data OWNER TO augur;
--
-- Name: augur_operations; Type: SCHEMA; Schema: -; Owner: augur
--
CREATE SCHEMA augur_operations;
ALTER SCHEMA augur_operations OWNER TO augur;
--
-- Name: spdx; Type: SCHEMA; Schema: -; Owner: augur
--
CREATE SCHEMA spdx;
ALTER SCHEMA spdx OWNER TO augur;
--
-- Name: toss_specific; Type: SCHEMA; Schema: -; Owner: augur
--
CREATE SCHEMA toss_specific;
ALTER SCHEMA toss_specific OWNER TO augur;
--
-- Name: refresh_aggregates(); Type: PROCEDURE; Schema: augur_data; Owner: augur
--
CREATE PROCEDURE augur_data.refresh_aggregates()
LANGUAGE plpgsql
AS $$
begin
perform pg_advisory_lock(124);
execute 'REFRESH MATERIALIZED VIEW "augur_data"."issue_reporter_created_at"';
perform pg_advisory_unlock(124);
end;
$$;
ALTER PROCEDURE augur_data.refresh_aggregates() OWNER TO augur;
--
-- Name: create_constraint_if_not_exists(text, text, text); Type: FUNCTION; Schema: public; Owner: augur
--
CREATE FUNCTION public.create_constraint_if_not_exists(t_name text, c_name text, constraint_sql text) RETURNS void
LANGUAGE plpgsql
AS $$
BEGIN
-- Look for our constraint
IF NOT EXISTS (SELECT constraint_name
FROM information_schema.constraint_column_usage
WHERE constraint_name = c_name) THEN
EXECUTE 'ALTER TABLE ' || t_name || ' ADD CONSTRAINT ' || c_name || ' ' || constraint_sql;
END IF;
END;
$$;
ALTER FUNCTION public.create_constraint_if_not_exists(t_name text, c_name text, constraint_sql text) OWNER TO augur;
--
-- Name: pc_chartoint(character varying); Type: FUNCTION; Schema: public; Owner: augur
--
CREATE FUNCTION public.pc_chartoint(chartoconvert character varying) RETURNS integer
LANGUAGE sql IMMUTABLE STRICT
AS $_$
SELECT CASE WHEN trim($1) SIMILAR TO '[0-9]+'
THEN CAST(trim($1) AS integer)
ELSE NULL END;
$_$;
ALTER FUNCTION public.pc_chartoint(chartoconvert character varying) OWNER TO augur;
--
-- Name: refresh_aggregates(); Type: PROCEDURE; Schema: public; Owner: augur
--
CREATE PROCEDURE public.refresh_aggregates()
LANGUAGE plpgsql
AS $$
begin
perform pg_advisory_lock(124);
execute 'REFRESH MATERIALIZED VIEW "augur_data"."issue_reporter_created_at"';
perform pg_advisory_unlock(124);
end;
$$;
ALTER PROCEDURE public.refresh_aggregates() OWNER TO augur;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: analysis_log; Type: TABLE; Schema: augur_data; Owner: augur
--
CREATE TABLE augur_data.analysis_log (
repos_id integer NOT NULL,
status character varying NOT NULL,
date_attempted timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
);
ALTER TABLE augur_data.analysis_log OWNER TO augur;
--
-- Name: pull_requests_pull_request_id_seq; Type: SEQUENCE; Schema: augur_data; Owner: augur
--
CREATE SEQUENCE augur_data.pull_requests_pull_request_id_seq
START WITH 25430
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE augur_data.pull_requests_pull_request_id_seq OWNER TO augur;
--
-- Name: pull_requests; Type: TABLE; Schema: augur_data; Owner: augur
--
CREATE TABLE augur_data.pull_requests (
pull_request_id bigint DEFAULT nextval('augur_data.pull_requests_pull_request_id_seq'::regclass) NOT NULL,
repo_id bigint DEFAULT 0,
pr_url character varying,
pr_src_id bigint,
pr_src_node_id character varying,
pr_html_url character varying,
pr_diff_url character varying,
pr_patch_url character varying,
pr_issue_url character varying,
pr_augur_issue_id bigint,
pr_src_number bigint,
pr_src_state character varying,
pr_src_locked boolean,
pr_src_title character varying,
pr_body text,
pr_created_at timestamp(0) without time zone,
pr_updated_at timestamp(0) without time zone,
pr_closed_at timestamp(0) without time zone,
pr_merged_at timestamp(0) without time zone,
pr_merge_commit_sha character varying,
pr_teams bigint,
pr_milestone character varying,
pr_commits_url character varying,
pr_review_comments_url character varying,
pr_review_comment_url character varying,
pr_comments_url character varying,
pr_statuses_url character varying,
pr_meta_head_id character varying,
pr_meta_base_id character varying,
pr_src_issue_url character varying,
pr_src_comments_url character varying,
pr_src_review_comments_url character varying,
pr_src_commits_url character varying,
pr_src_statuses_url character varying,
pr_src_author_association character varying,
tool_source character varying,
tool_version character varying,
data_source character varying,
data_collection_date timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP,
pr_augur_contributor_id uuid
);
ALTER TABLE augur_data.pull_requests OWNER TO augur;
--
-- Name: COLUMN pull_requests.pr_src_id; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.pull_requests.pr_src_id IS 'The pr_src_id is unique across all of github.';
--
-- Name: COLUMN pull_requests.pr_augur_issue_id; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.pull_requests.pr_augur_issue_id IS 'This is to link to the augur stored related issue';
--
-- Name: COLUMN pull_requests.pr_src_number; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.pull_requests.pr_src_number IS 'The pr_src_number is unique within a repository.';
--
-- Name: COLUMN pull_requests.pr_teams; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.pull_requests.pr_teams IS 'One to many with pull request teams. ';
--
-- Name: COLUMN pull_requests.pr_review_comment_url; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.pull_requests.pr_review_comment_url IS 'This is a field with limited utility. It does expose how to access a specific comment if needed with parameters. If the source changes URL structure, it may be useful';
--
-- Name: COLUMN pull_requests.pr_meta_head_id; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.pull_requests.pr_meta_head_id IS 'The metadata for the head repo that links to the pull_request_meta table. ';
--
-- Name: COLUMN pull_requests.pr_meta_base_id; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.pull_requests.pr_meta_base_id IS 'The metadata for the base repo that links to the pull_request_meta table. ';
--
-- Name: COLUMN pull_requests.pr_augur_contributor_id; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.pull_requests.pr_augur_contributor_id IS 'This is to link to the augur contributor record. ';
--
-- Name: api_get_all_repo_prs; Type: MATERIALIZED VIEW; Schema: augur_data; Owner: augur
--
CREATE MATERIALIZED VIEW augur_data.api_get_all_repo_prs AS
SELECT pull_requests.repo_id,
count(*) AS pull_requests_all_time
FROM augur_data.pull_requests
GROUP BY pull_requests.repo_id
WITH NO DATA;
ALTER TABLE augur_data.api_get_all_repo_prs OWNER TO augur;
--
-- Name: commits_cmt_id_seq; Type: SEQUENCE; Schema: augur_data; Owner: augur
--
CREATE SEQUENCE augur_data.commits_cmt_id_seq
START WITH 25430
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE augur_data.commits_cmt_id_seq OWNER TO augur;
--
-- Name: commits; Type: TABLE; Schema: augur_data; Owner: augur
--
CREATE TABLE augur_data.commits (
cmt_id bigint DEFAULT nextval('augur_data.commits_cmt_id_seq'::regclass) NOT NULL,
repo_id bigint NOT NULL,
cmt_commit_hash character varying(80) NOT NULL,
cmt_author_name character varying NOT NULL,
cmt_author_raw_email character varying NOT NULL,
cmt_author_email character varying NOT NULL,
cmt_author_date character varying(10) NOT NULL,
cmt_author_affiliation character varying,
cmt_committer_name character varying NOT NULL,
cmt_committer_raw_email character varying NOT NULL,
cmt_committer_email character varying NOT NULL,
cmt_committer_date character varying NOT NULL,
cmt_committer_affiliation character varying,
cmt_added integer NOT NULL,
cmt_removed integer NOT NULL,
cmt_whitespace integer NOT NULL,
cmt_filename character varying NOT NULL,
cmt_date_attempted timestamp(0) without time zone NOT NULL,
cmt_ght_committer_id integer,
cmt_ght_committed_at timestamp(0) without time zone,
cmt_committer_timestamp timestamp(0) with time zone,
cmt_author_timestamp timestamp(0) with time zone,
cmt_author_platform_username character varying,
tool_source character varying,
tool_version character varying,
data_source character varying,
data_collection_date timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP,
cmt_ght_author_id uuid
)
WITH (autovacuum_vacuum_scale_factor='0', autovacuum_vacuum_threshold='1000');
ALTER TABLE augur_data.commits OWNER TO augur;
--
-- Name: TABLE commits; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON TABLE augur_data.commits IS 'Commits.
Each row represents changes to one FILE within a single commit. So you will encounter multiple rows per commit hash in many cases. ';
--
-- Name: api_get_all_repos_commits; Type: MATERIALIZED VIEW; Schema: augur_data; Owner: augur
--
CREATE MATERIALIZED VIEW augur_data.api_get_all_repos_commits AS
SELECT commits.repo_id,
count(DISTINCT commits.cmt_commit_hash) AS commits_all_time
FROM augur_data.commits
GROUP BY commits.repo_id
WITH NO DATA;
ALTER TABLE augur_data.api_get_all_repos_commits OWNER TO augur;
--
-- Name: issue_seq; Type: SEQUENCE; Schema: augur_data; Owner: augur
--
CREATE SEQUENCE augur_data.issue_seq
START WITH 31000
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE augur_data.issue_seq OWNER TO augur;
--
-- Name: issues; Type: TABLE; Schema: augur_data; Owner: augur
--
CREATE TABLE augur_data.issues (
issue_id bigint DEFAULT nextval('augur_data.issue_seq'::regclass) NOT NULL,
repo_id bigint,
pull_request bigint,
pull_request_id bigint,
created_at timestamp(0) without time zone,
issue_title character varying,
issue_body character varying,
comment_count bigint,
updated_at timestamp(0) without time zone,
closed_at timestamp(0) without time zone,
due_on timestamp(0) without time zone,
repository_url character varying,
issue_url character varying,
labels_url character varying,
comments_url character varying,
events_url character varying,
html_url character varying,
issue_state character varying,
issue_node_id character varying,
gh_issue_number bigint,
gh_issue_id bigint,
gh_user_id bigint,
tool_source character varying,
tool_version character varying,
data_source character varying,
data_collection_date timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP,
reporter_id uuid,
cntrb_id uuid
);
ALTER TABLE augur_data.issues OWNER TO augur;
--
-- Name: COLUMN issues.reporter_id; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.issues.reporter_id IS 'The ID of the person who opened the issue. ';
--
-- Name: COLUMN issues.cntrb_id; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.issues.cntrb_id IS 'The ID of the person who closed the issue. ';
--
-- Name: api_get_all_repos_issues; Type: MATERIALIZED VIEW; Schema: augur_data; Owner: augur
--
CREATE MATERIALIZED VIEW augur_data.api_get_all_repos_issues AS
SELECT issues.repo_id,
count(*) AS issues_all_time
FROM augur_data.issues
WHERE (issues.pull_request IS NULL)
GROUP BY issues.repo_id
WITH NO DATA;
ALTER TABLE augur_data.api_get_all_repos_issues OWNER TO augur;
--
-- Name: augur_data.repo_insights_ri_id_seq; Type: SEQUENCE; Schema: augur_data; Owner: augur
--
CREATE SEQUENCE augur_data."augur_data.repo_insights_ri_id_seq"
START WITH 25430
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE augur_data."augur_data.repo_insights_ri_id_seq" OWNER TO augur;
--
-- Name: commit_comment_ref_cmt_comment_id_seq; Type: SEQUENCE; Schema: augur_data; Owner: augur
--
CREATE SEQUENCE augur_data.commit_comment_ref_cmt_comment_id_seq
START WITH 25430
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE augur_data.commit_comment_ref_cmt_comment_id_seq OWNER TO augur;
--
-- Name: commit_comment_ref; Type: TABLE; Schema: augur_data; Owner: augur
--
CREATE TABLE augur_data.commit_comment_ref (
cmt_comment_id bigint DEFAULT nextval('augur_data.commit_comment_ref_cmt_comment_id_seq'::regclass) NOT NULL,
cmt_id bigint NOT NULL,
repo_id bigint,
msg_id bigint NOT NULL,
user_id bigint NOT NULL,
body text,
line bigint,
"position" bigint,
commit_comment_src_node_id character varying,
cmt_comment_src_id bigint NOT NULL,
created_at timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
tool_source character varying,
tool_version character varying,
data_source character varying,
data_collection_date timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP
);
ALTER TABLE augur_data.commit_comment_ref OWNER TO augur;
--
-- Name: COLUMN commit_comment_ref.commit_comment_src_node_id; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.commit_comment_ref.commit_comment_src_node_id IS 'For data provenance, we store the source node ID if it exists. ';
--
-- Name: COLUMN commit_comment_ref.cmt_comment_src_id; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.commit_comment_ref.cmt_comment_src_id IS 'For data provenance, we store the source ID if it exists. ';
--
-- Name: contributors; Type: TABLE; Schema: augur_data; Owner: augur
--
CREATE TABLE augur_data.contributors (
cntrb_login character varying,
cntrb_email character varying,
cntrb_full_name character varying,
cntrb_company character varying,
cntrb_created_at timestamp(0) without time zone,
cntrb_type character varying,
cntrb_fake smallint DEFAULT 0,
cntrb_deleted smallint DEFAULT 0,
cntrb_long numeric(11,8) DEFAULT NULL::numeric,
cntrb_lat numeric(10,8) DEFAULT NULL::numeric,
cntrb_country_code character(3) DEFAULT NULL::bpchar,
cntrb_state character varying,
cntrb_city character varying,
cntrb_location character varying,
cntrb_canonical character varying,
cntrb_last_used timestamp(0) with time zone DEFAULT NULL::timestamp with time zone,
gh_user_id bigint,
gh_login character varying,
gh_url character varying,
gh_html_url character varying,
gh_node_id character varying,
gh_avatar_url character varying,
gh_gravatar_id character varying,
gh_followers_url character varying,
gh_following_url character varying,
gh_gists_url character varying,
gh_starred_url character varying,
gh_subscriptions_url character varying,
gh_organizations_url character varying,
gh_repos_url character varying,
gh_events_url character varying,
gh_received_events_url character varying,
gh_type character varying,
gh_site_admin character varying,
gl_web_url character varying,
gl_avatar_url character varying,
gl_state character varying,
gl_username character varying,
gl_full_name character varying,
gl_id bigint,
tool_source character varying,
tool_version character varying,
data_source character varying,
data_collection_date timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP,
cntrb_id uuid NOT NULL
);
ALTER TABLE augur_data.contributors OWNER TO augur;
--
-- Name: TABLE contributors; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON TABLE augur_data.contributors IS 'For GitHub, this should be repeated from gh_login. for other systems, it should be that systems login.
Github now allows a user to change their login name, but their user id remains the same in this case. So, the natural key is the combination of id and login, but there should never be repeated logins. ';
--
-- Name: COLUMN contributors.cntrb_login; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.contributors.cntrb_login IS 'Will be a double population with the same value as gh_login for github, but the local value for other systems. ';
--
-- Name: COLUMN contributors.cntrb_email; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.contributors.cntrb_email IS 'This needs to be here for matching contributor ids, which are augur, to the commit information. ';
--
-- Name: COLUMN contributors.cntrb_type; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.contributors.cntrb_type IS 'Present in another models. It is not currently used in Augur. ';
--
-- Name: COLUMN contributors.gh_login; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.contributors.gh_login IS 'populated with the github user name for github originated data. ';
--
-- Name: COLUMN contributors.gl_web_url; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.contributors.gl_web_url IS '“web_url” value from these API calls to GitLab, all for the same user
https://gitlab.com/api/v4/users?username=computationalmystic
https://gitlab.com/api/v4/[email protected]
https://gitlab.com/api/v4/[email protected]
[
{
"id": 5481034,
"name": "sean goggins",
"username": "computationalmystic",
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/fb1fb43953a6059df2fe8d94b21d575c?s=80&d=identicon",
"web_url": "https://gitlab.com/computationalmystic"
}
]';
--
-- Name: COLUMN contributors.gl_avatar_url; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.contributors.gl_avatar_url IS '“avatar_url” value from these API calls to GitLab, all for the same user
https://gitlab.com/api/v4/users?username=computationalmystic
https://gitlab.com/api/v4/[email protected]
https://gitlab.com/api/v4/[email protected]
[
{
"id": 5481034,
"name": "sean goggins",
"username": "computationalmystic",
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/fb1fb43953a6059df2fe8d94b21d575c?s=80&d=identicon",
"web_url": "https://gitlab.com/computationalmystic"
}
]';
--
-- Name: COLUMN contributors.gl_state; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.contributors.gl_state IS '“state” value from these API calls to GitLab, all for the same user
https://gitlab.com/api/v4/users?username=computationalmystic
https://gitlab.com/api/v4/[email protected]
https://gitlab.com/api/v4/[email protected]
[
{
"id": 5481034,
"name": "sean goggins",
"username": "computationalmystic",
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/fb1fb43953a6059df2fe8d94b21d575c?s=80&d=identicon",
"web_url": "https://gitlab.com/computationalmystic"
}
]';
--
-- Name: COLUMN contributors.gl_username; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.contributors.gl_username IS '“username” value from these API calls to GitLab, all for the same user
https://gitlab.com/api/v4/users?username=computationalmystic
https://gitlab.com/api/v4/[email protected]
https://gitlab.com/api/v4/[email protected]
[
{
"id": 5481034,
"name": "sean goggins",
"username": "computationalmystic",
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/fb1fb43953a6059df2fe8d94b21d575c?s=80&d=identicon",
"web_url": "https://gitlab.com/computationalmystic"
}
]';
--
-- Name: COLUMN contributors.gl_full_name; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.contributors.gl_full_name IS '“name” value from these API calls to GitLab, all for the same user
https://gitlab.com/api/v4/users?username=computationalmystic
https://gitlab.com/api/v4/[email protected]
https://gitlab.com/api/v4/[email protected]
[
{
"id": 5481034,
"name": "sean goggins",
"username": "computationalmystic",
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/fb1fb43953a6059df2fe8d94b21d575c?s=80&d=identicon",
"web_url": "https://gitlab.com/computationalmystic"
}
]';
--
-- Name: COLUMN contributors.gl_id; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.contributors.gl_id IS '"id" value from these API calls to GitLab, all for the same user
https://gitlab.com/api/v4/users?username=computationalmystic
https://gitlab.com/api/v4/[email protected]
https://gitlab.com/api/v4/[email protected]
[
{
"id": 5481034,
"name": "sean goggins",
"username": "computationalmystic",
"state": "active",
"avatar_url": "https://secure.gravatar.com/avatar/fb1fb43953a6059df2fe8d94b21d575c?s=80&d=identicon",
"web_url": "https://gitlab.com/computationalmystic"
}
]';
--
-- Name: issue_events_event_id_seq; Type: SEQUENCE; Schema: augur_data; Owner: augur
--
CREATE SEQUENCE augur_data.issue_events_event_id_seq
START WITH 25430
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE augur_data.issue_events_event_id_seq OWNER TO augur;
--
-- Name: issue_events; Type: TABLE; Schema: augur_data; Owner: augur
--
CREATE TABLE augur_data.issue_events (
event_id bigint DEFAULT nextval('augur_data.issue_events_event_id_seq'::regclass) NOT NULL,
issue_id bigint NOT NULL,
repo_id bigint,
action character varying NOT NULL,
action_commit_hash character varying,
created_at timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
node_id character varying,
node_url character varying,
platform_id bigint NOT NULL,
issue_event_src_id bigint,
tool_source character varying,
tool_version character varying,
data_source character varying,
data_collection_date timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP,
cntrb_id uuid
);
ALTER TABLE augur_data.issue_events OWNER TO augur;
--
-- Name: COLUMN issue_events.node_id; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.issue_events.node_id IS 'This should be renamed to issue_event_src_node_id, as its the varchar identifier in GitHub and likely common in other sources as well. However, since it was created before we came to this naming standard and workers are built around it, we have it simply named as node_id. Anywhere you see node_id in the schema, it comes from GitHubs terminology.';
--
-- Name: COLUMN issue_events.issue_event_src_id; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.issue_events.issue_event_src_id IS 'This ID comes from the source. In the case of GitHub, it is the id that is the first field returned from the issue events API';
--
-- Name: issue_message_ref_issue_msg_ref_id_seq; Type: SEQUENCE; Schema: augur_data; Owner: augur
--
CREATE SEQUENCE augur_data.issue_message_ref_issue_msg_ref_id_seq
START WITH 25430
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE augur_data.issue_message_ref_issue_msg_ref_id_seq OWNER TO augur;
--
-- Name: issue_message_ref; Type: TABLE; Schema: augur_data; Owner: augur
--
CREATE TABLE augur_data.issue_message_ref (
issue_msg_ref_id bigint DEFAULT nextval('augur_data.issue_message_ref_issue_msg_ref_id_seq'::regclass) NOT NULL,
issue_id bigint,
repo_id bigint,
msg_id bigint,
issue_msg_ref_src_node_id character varying,
issue_msg_ref_src_comment_id bigint,
tool_source character varying,
tool_version character varying,
data_source character varying,
data_collection_date timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP
);
ALTER TABLE augur_data.issue_message_ref OWNER TO augur;
--
-- Name: COLUMN issue_message_ref.issue_msg_ref_src_node_id; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.issue_message_ref.issue_msg_ref_src_node_id IS 'This character based identifier comes from the source. In the case of GitHub, it is the id that is the first field returned from the issue comments API';
--
-- Name: COLUMN issue_message_ref.issue_msg_ref_src_comment_id; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.issue_message_ref.issue_msg_ref_src_comment_id IS 'This ID comes from the source. In the case of GitHub, it is the id that is the first field returned from the issue comments API';
--
-- Name: message_msg_id_seq; Type: SEQUENCE; Schema: augur_data; Owner: augur
--
CREATE SEQUENCE augur_data.message_msg_id_seq
START WITH 25430
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE augur_data.message_msg_id_seq OWNER TO augur;
--
-- Name: message; Type: TABLE; Schema: augur_data; Owner: augur
--
CREATE TABLE augur_data.message (
msg_id bigint DEFAULT nextval('augur_data.message_msg_id_seq'::regclass) NOT NULL,
rgls_id bigint,
platform_msg_id bigint,
platform_node_id character varying,
repo_id bigint,
msg_text character varying,
msg_timestamp timestamp(0) without time zone,
msg_sender_email character varying,
msg_header character varying,
pltfrm_id bigint NOT NULL,
tool_source character varying,
tool_version character varying,
data_source character varying,
data_collection_date timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP,
cntrb_id uuid
);
ALTER TABLE augur_data.message OWNER TO augur;
--
-- Name: COLUMN message.cntrb_id; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.message.cntrb_id IS 'Not populated for mailing lists. Populated for GitHub issues. ';
--
-- Name: pull_request_message_ref_pr_msg_ref_id_seq; Type: SEQUENCE; Schema: augur_data; Owner: augur
--
CREATE SEQUENCE augur_data.pull_request_message_ref_pr_msg_ref_id_seq
START WITH 25430
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE augur_data.pull_request_message_ref_pr_msg_ref_id_seq OWNER TO augur;
--
-- Name: pull_request_message_ref; Type: TABLE; Schema: augur_data; Owner: augur
--
CREATE TABLE augur_data.pull_request_message_ref (
pr_msg_ref_id bigint DEFAULT nextval('augur_data.pull_request_message_ref_pr_msg_ref_id_seq'::regclass) NOT NULL,
pull_request_id bigint,
repo_id bigint,
msg_id bigint,
pr_message_ref_src_comment_id bigint,
pr_message_ref_src_node_id character varying,
pr_issue_url character varying,
tool_source character varying,
tool_version character varying,
data_source character varying,
data_collection_date timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP
);
ALTER TABLE augur_data.pull_request_message_ref OWNER TO augur;
--
-- Name: repo_repo_id_seq; Type: SEQUENCE; Schema: augur_data; Owner: augur
--
CREATE SEQUENCE augur_data.repo_repo_id_seq
START WITH 25430
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE augur_data.repo_repo_id_seq OWNER TO augur;
--
-- Name: repo; Type: TABLE; Schema: augur_data; Owner: augur
--
CREATE TABLE augur_data.repo (
repo_id bigint DEFAULT nextval('augur_data.repo_repo_id_seq'::regclass) NOT NULL,
repo_group_id bigint NOT NULL,
repo_git character varying NOT NULL,
repo_path character varying DEFAULT 'NULL'::character varying,
repo_name character varying DEFAULT 'NULL'::character varying,
repo_added timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL,
repo_type character varying DEFAULT ''::character varying,
url character varying,
owner_id integer,
description character varying,
primary_language character varying,
created_at character varying,
forked_from character varying,
updated_at timestamp(0) without time zone,
repo_archived_date_collected timestamp(0) with time zone,
repo_archived integer,
tool_source character varying,
tool_version character varying,
data_source character varying,
data_collection_date timestamp(0) without time zone DEFAULT CURRENT_TIMESTAMP
);
ALTER TABLE augur_data.repo OWNER TO augur;
--
-- Name: TABLE repo; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON TABLE augur_data.repo IS 'This table is a combination of the columns in Facade’s repo table and GHTorrent’s projects table. ';
--
-- Name: COLUMN repo.repo_type; Type: COMMENT; Schema: augur_data; Owner: augur
--
COMMENT ON COLUMN augur_data.repo.repo_type IS 'This field is intended to indicate if the repository is the "main instance" of a repository in cases where implementations choose to add the same repository to more than one repository group. In cases where the repository group is of rg_type Github Organization then this repo_type should be "primary". In other cases the repo_type should probably be "user created". We made this a varchar in order to hold open the possibility that there are additional repo_types we have not thought about. ';
--
-- Name: augur_new_contributors; Type: MATERIALIZED VIEW; Schema: augur_data; Owner: augur
--
CREATE MATERIALIZED VIEW augur_data.augur_new_contributors AS
SELECT x.cntrb_id,
x.created_at,
x.month,
x.year,
x.repo_id,
x.repo_name,
x.full_name,
x.login,
x.rank
FROM ( SELECT b.cntrb_id,
b.created_at,
b.month,
b.year,
b.repo_id,
b.repo_name,
b.full_name,
b.login,
b.action,
b.rank
FROM ( SELECT a.id AS cntrb_id,
a.created_at,
date_part('month'::text, (a.created_at)::date) AS month,
date_part('year'::text, (a.created_at)::date) AS year,
a.repo_id,
repo.repo_name,
a.full_name,
a.login,
a.action,
rank() OVER (PARTITION BY a.id ORDER BY a.created_at) AS rank
FROM ( SELECT canonical_full_names.canonical_id AS id,
issues.created_at,
issues.repo_id,
'issue_opened'::text AS action,
contributors.cntrb_full_name AS full_name,