forked from benfred/github-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
68 lines (61 loc) · 1.4 KB
/
schema.sql
File metadata and controls
68 lines (61 loc) · 1.4 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
CREATE TABLE repos
(
id integer PRIMARY KEY,
name varchar(200) NOT NULL,
language varchar(50),
description text,
license text,
homepage text,
size integer NOT NULL default 0,
stars integer NOT NULL default 0,
forks integer NOT NULL default 0,
topics text[],
deleted boolean NOT NULL default false,
parentid integer,
ownerid integer,
created timestamp without time zone,
modified timestamp without time zone,
fetched timestamp without time zone,
statuscode integer
);
CREATE TABLE users
(
id integer PRIMARY KEY,
login varchar(200) NOT NULL,
name text,
company text,
location text,
bio text,
email text,
blog text,
type text,
followers integer,
following integer,
created timestamp without time zone,
modified timestamp without time zone,
fetched timestamp without time zone,
statuscode integer
);
CREATE TABLE organization_members
(
organization integer PRIMARY KEY,
members integer[],
fetched timestamp without time zone,
statuscode integer
);
CREATE TABLE locations
(
location text PRIMARY KEY,
fetched timestamp without time zone,
data jsonb,
city text,
state text,
country text
);
CREATE INDEX repos_name_index ON repos (name);
CREATE INDEX users_login_index ON users(login);
/* migrations: TODO: proper up/down
alter table repos add column license text;
alter table repos add column homepage text;
alter table users add column blog text;
*/