-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdbsql.sql
More file actions
executable file
·28 lines (27 loc) · 918 Bytes
/
dbsql.sql
File metadata and controls
executable file
·28 lines (27 loc) · 918 Bytes
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
/** SQLite SQL **/
DROP TABLE IF EXISTS peers;
CREATE TABLE peers (
id INTEGER PRIMARY KEY AUTOINCREMENT,
info_hash BINARY(20) NOT NULL,
ip INTEGER(11) NOT NULL,
port INTEGER(5) NOT NULL,
peer_id BINARY(20) NOT NULL,
uploaded INTEGER(20) NOT NULL default 0,
downloaded INTEGER(20) NOT NULL default 0,
remaining INTEGER(20) NOT NULL default 0,
update_time INTEGER(14) NOT NULL,
expire_time INTEGER(14) NOT NULL
);
/** MySQL SQL **/
DROP TABLE IF EXISTS peers;
CREATE TABLE `peers` (
`id` INT(20) PRIMARY KEY AUTO_INCREMENT NOT NULL,
`info_hash` BINARY(20) NOT NULL,
`ip` INT(11) NOT NULL, `port` INT(5) NOT NULL,
`peer_id` BINARY(20) NOT NULL,
`uploaded` INT(20) NOT NULL DEFAULT 0,
`downloaded` INT(20) NOT NULL DEFAULT 0,
`remaining` INT(20) NOT NULL DEFAULT 0,
`update_time` INT NOT NULL,
`expire_time` INT NOT NULL
);