forked from jimpick/twitterfon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create.sql
62 lines (56 loc) · 1.95 KB
/
create.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
CREATE TABLE statuses (
'id' INTEGER,
'type' INTEGER,
'user_id' INTEGER,
'text' TEXT,
'created_at' INTEGER,
'source' TEXT,
'favorited' INTEGER,
'truncated' INTEGER,
'in_reply_to_status_id' INTEGER,
'in_reply_to_user_id' INTEGER,
'in_reply_to_screen_name' TEXT,
PRIMARY KEY(type, id)
);
CREATE INDEX statuses_in_reply_to_status_id on statuses(in_reply_to_status_id);
CREATE TABLE direct_messages (
'id' INTEGER,
'sender_id' INTEGER,
'recipient_id' INTEGER,
'text' TEXT,
'created_at' INTEGER,
'sender_screen_name' TEXT,
'recipient_screen_name' TEXT,
PRIMARY KEY(id)
);
CREATE INDEX direct_messages_sender_id on direct_messages(sender_id);
CREATE INDEX direct_messages_recipient_id on direct_messages(recipient_id);
CREATE TABLE users (
'user_id' INTEGER PRIMARY KEY,
'name' TEXT,
'screen_name' TEXT,
'location' TEXT,
'description' TEXT,
'url' TEXT,
'followers_count' INTEGER,
'profile_image_url' TEXT,
'protected' INTEGER
);
CREATE INDEX users_name on users(name);
CREATE INDEX users_screen_name on users(screen_name);
CREATE TABLE followees (
'user_id' INTEGER PRIMARY KEY,
'name' TEXT,
'screen_name' TEXT,
'profile_image_url' TEXT
);
CREATE INDEX followees_name on followees(name);
CREATE INDEX followees_screen_name on followees(screen_name);
CREATE TABLE images (
'url' TEXT PRIMARY KEY,
'image' BLOB,
'updated_at' DATETIME
);
CREATE TABLE queries (
'query' TEXT PRIMARY KEY
);