-
Notifications
You must be signed in to change notification settings - Fork 10
/
1560510971_initial_schema.up.sql
executable file
·267 lines (250 loc) · 5.65 KB
/
1560510971_initial_schema.up.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
BEGIN;
CREATE TABLE organizations (
kallax_id serial NOT NULL PRIMARY KEY,
avatar_url text,
billing_email text,
blog text,
collaborators bigint,
company text,
created_at timestamptz,
description text,
disk_usage bigint,
email text,
followers bigint,
following bigint,
htmlurl text,
id bigint,
location text,
login text,
name text,
node_id text,
owned_private_repos bigint,
private_gists bigint,
public_gists bigint,
public_repos bigint,
total_private_repos bigint,
two_factor_requirement_enabled boolean,
type text,
updated_at timestamptz
);
CREATE TABLE users (
kallax_id serial NOT NULL PRIMARY KEY,
avatar_url text,
bio text,
blog text,
collaborators bigint,
company text,
created_at timestamptz,
disk_usage bigint,
email text,
followers bigint,
following bigint,
gravatar_id text,
hireable boolean,
htmlurl text,
id bigint,
location text,
login text,
name text,
node_id text,
owned_private_repos bigint,
private_gists bigint,
public_gists bigint,
public_repos bigint,
site_admin boolean,
suspended_at timestamptz,
total_private_repos bigint,
two_factor_authentication boolean,
type text,
updated_at timestamptz
);
CREATE TABLE repositories (
kallax_id serial NOT NULL PRIMARY KEY,
allow_merge_commit boolean,
allow_rebase_merge boolean,
allow_squash_merge boolean,
archived boolean,
auto_init boolean,
clone_url text,
code_of_conduct jsonb,
created_at timestamptz,
default_branch text,
description text,
disabled boolean,
fork boolean,
forks_count bigint,
full_name text,
git_url text,
gitignore_template text,
has_downloads boolean,
has_issues boolean,
has_pages boolean,
has_projects boolean,
has_wiki boolean,
homepage text,
htmlurl text,
id bigint,
language text,
license jsonb,
license_template text,
master_branch text,
mirror_url text,
name text,
network_count bigint,
node_id text,
open_issues_count bigint,
organization_id bigint NOT NULL,
organization_name text NOT NULL,
owner_id bigint NOT NULL,
owner_login text NOT NULL,
owner_type text NOT NULL,
parent jsonb,
permissions jsonb,
private boolean,
pushed_at timestamptz,
size bigint,
source jsonb,
sshurl text,
stargazers_count bigint,
subscribers_count bigint,
svnurl text,
team_id bigint,
topics text[] NOT NULL,
updated_at timestamptz,
watchers_count bigint
);
CREATE TABLE issues (
kallax_id serial NOT NULL PRIMARY KEY,
assignee_id bigint NOT NULL,
assignee_login text NOT NULL,
assignees jsonb NOT NULL,
body text,
closed_at timestamptz,
closed_by_id bigint NOT NULL,
closed_by_login text NOT NULL,
comments bigint,
created_at timestamptz,
htmlurl text,
id bigint,
labels text[] NOT NULL,
locked boolean,
milestone_id bigint NOT NULL,
milestone_title text NOT NULL,
node_id text,
number bigint,
repository_name text NOT NULL,
repository_owner text NOT NULL,
state text,
title text,
updated_at timestamptz,
user_id bigint NOT NULL,
user_login text NOT NULL
);
CREATE TABLE issue_comments (
kallax_id serial NOT NULL PRIMARY KEY,
author_association text,
body text,
created_at timestamptz,
htmlurl text,
id bigint,
issue_number bigint NOT NULL,
node_id text,
reactions jsonb,
repository_name text NOT NULL,
repository_owner text NOT NULL,
updated_at timestamptz,
user_id bigint NOT NULL,
user_login text NOT NULL
);
CREATE TABLE pull_requests (
kallax_id serial NOT NULL PRIMARY KEY,
additions bigint,
assignee_id bigint NOT NULL,
assignee_login text NOT NULL,
assignees jsonb NOT NULL,
author_association text,
base_label text NOT NULL,
base_ref text NOT NULL,
base_repository_name text NOT NULL,
base_repository_owner text NOT NULL,
base_sha text NOT NULL,
base_user text NOT NULL,
body text,
changed_files bigint,
closed_at timestamptz,
comments bigint,
commits bigint,
created_at timestamptz,
deletions bigint,
draft boolean,
head_label text NOT NULL,
head_ref text NOT NULL,
head_repository_name text NOT NULL,
head_repository_owner text NOT NULL,
head_sha text NOT NULL,
head_user text NOT NULL,
htmlurl text,
id bigint,
labels text[] NOT NULL,
maintainer_can_modify boolean,
merge_commit_sha text,
mergeable boolean,
mergeable_state text,
merged boolean,
merged_at timestamptz,
merged_by_id bigint NOT NULL,
merged_by_login text NOT NULL,
milestone_id bigint NOT NULL,
milestone_title text NOT NULL,
node_id text,
number bigint,
repository_name text NOT NULL,
repository_owner text NOT NULL,
requested_reviewers jsonb NOT NULL,
review_comments bigint,
state text,
title text,
updated_at timestamptz,
user_id bigint NOT NULL,
user_login text NOT NULL
);
CREATE TABLE pull_request_reviews (
kallax_id serial NOT NULL PRIMARY KEY,
body text,
commit_id text,
htmlurl text,
id bigint,
node_id text,
pull_request_number bigint NOT NULL,
repository_name text NOT NULL,
repository_owner text NOT NULL,
state text,
submitted_at timestamptz,
user_id bigint NOT NULL,
user_login text NOT NULL
);
CREATE TABLE pull_request_comments (
kallax_id serial NOT NULL PRIMARY KEY,
author_association text,
body text,
commit_id text,
created_at timestamptz,
diff_hunk text,
htmlurl text,
id bigint,
in_reply_to bigint,
node_id text,
original_commit_id text,
original_position bigint,
path text,
position bigint,
pull_request_number bigint NOT NULL,
pull_request_review_id bigint,
reactions jsonb,
repository_name text NOT NULL,
repository_owner text NOT NULL,
updated_at timestamptz,
user_id bigint NOT NULL,
user_login text NOT NULL
);
COMMIT;