-
Notifications
You must be signed in to change notification settings - Fork 0
/
makedb
62 lines (55 loc) · 1.3 KB
/
makedb
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
CREATE TABLE users (
'user_id' INTEGER Primary key,
'name' TEXT,
'screenName' TEXT,
'email' TEXT,
'location' TEXT,
'meetsCount' INTEGER,
'profileImageUrl' TEXT
);
CREATE INDEX users_name on users(name);
CREATE TABLE meets (
'id' INTEGER,
'postId' INTEGER,
'userId' INTEGER,
'type' INTEGER,
'timeAt' INTEGER,
'updateAt' INTEGER,
'longitude' TEXT,
'latitude' TEXT,
'description' TEXT,
'source' TEXT,
'user_count' INTEGER,
PRIMARY KEY(id,postid,type)
);
CREATE INDEX meet_ids on meets(id);
CREATE INDEX post_ids on meets(postId);
CREATE TABLE news (
'id' INTEGER,
'odd' INTEGER,
'uid' INTEGER,
'cid' INTEGER,
'data' TEXT,
PRIMARY KEY(id)
);
CREATE INDEX news_ids on news(id);
CREATE INDEX news_odds on news(odd);
CREATE INDEX cirkle_uids on news(uid);
CREATE INDEX cirkle_cids on news(cid);
CREATE TABLE cirkles (
'id' INTEGER,
'odd' INTEGER,
'data' TEXT,
PRIMARY KEY(id)
);
CREATE INDEX cirkle_ids on cirkles(id);
CREATE INDEX cirkle_odds on cirkles(odd);
CREATE TABLE statistics (
'id' INTEGER,
'odd' INTEGER,
'cirkle' TEXT,
'news' TEXT,
'misc' TEXT,
PRIMARY KEY(id)
);
CREATE INDEX statistics_ids on statistics(id);