-
Notifications
You must be signed in to change notification settings - Fork 15
/
gazelle.sql
176 lines (165 loc) · 6.17 KB
/
gazelle.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
SET FOREIGN_KEY_CHECKS = 0;
CREATE DATABASE gazelle CHARACTER SET utf8 COLLATE utf8_swedish_ci;
USE gazelle;
CREATE TABLE `torrents` (
`ID` int(10) NOT NULL AUTO_INCREMENT,
`GroupID` int(10) NOT NULL,
`UserID` int(10) DEFAULT NULL,
`Media` varchar(20) DEFAULT NULL,
`Format` varchar(10) DEFAULT NULL,
`Encoding` varchar(15) DEFAULT NULL,
`Remastered` enum('0','1') NOT NULL DEFAULT '0',
`RemasterYear` int(4) DEFAULT NULL,
`RemasterTitle` varchar(80) NOT NULL DEFAULT '',
`RemasterCatalogueNumber` varchar(80) NOT NULL DEFAULT '',
`RemasterRecordLabel` varchar(80) NOT NULL DEFAULT '',
`Scene` enum('0','1') NOT NULL DEFAULT '0',
`HasLog` enum('0','1') NOT NULL DEFAULT '0',
`HasCue` enum('0','1') NOT NULL DEFAULT '0',
`HasLogDB` enum('0','1') NOT NULL DEFAULT '0',
`LogScore` int(6) NOT NULL DEFAULT '0',
`LogChecksum` enum('0','1') NOT NULL DEFAULT '1',
`info_hash` blob NOT NULL,
`FileCount` int(6) NOT NULL,
`FileList` mediumtext NOT NULL,
`FilePath` varchar(255) NOT NULL DEFAULT '',
`Size` bigint(12) NOT NULL,
`Leechers` int(6) NOT NULL DEFAULT '0',
`Seeders` int(6) NOT NULL DEFAULT '0',
`last_action` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`FreeTorrent` enum('0','1','2') NOT NULL DEFAULT '0',
`FreeLeechType` enum('0','1','2','3','4','5','6','7') NOT NULL DEFAULT '0',
`Time` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`Description` text,
`Snatched` int(10) unsigned NOT NULL DEFAULT '0',
`balance` bigint(20) NOT NULL DEFAULT '0',
`LastReseedRequest` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`TranscodedFrom` int(10) NOT NULL DEFAULT '0',
PRIMARY KEY (`ID`),
UNIQUE KEY `InfoHash` (`info_hash`(40)),
KEY `GroupID` (`GroupID`),
KEY `UserID` (`UserID`),
KEY `Media` (`Media`),
KEY `Format` (`Format`),
KEY `Encoding` (`Encoding`),
KEY `Year` (`RemasterYear`),
KEY `FileCount` (`FileCount`),
KEY `Size` (`Size`),
KEY `Seeders` (`Seeders`),
KEY `Leechers` (`Leechers`),
KEY `Snatched` (`Snatched`),
KEY `last_action` (`last_action`),
KEY `Time` (`Time`),
KEY `FreeTorrent` (`FreeTorrent`)
) ENGINE=InnoDB CHARSET utf8;
CREATE TABLE `users_freeleeches` (
`UserID` int(10) NOT NULL,
`TorrentID` int(10) NOT NULL,
`Time` datetime NOT NULL,
`Expired` tinyint(1) NOT NULL DEFAULT '0',
`Downloaded` bigint(20) NOT NULL DEFAULT '0',
`Uses` int(10) NOT NULL DEFAULT '1',
PRIMARY KEY (`UserID`,`TorrentID`),
KEY `Time` (`Time`),
KEY `Expired_Time` (`Expired`,`Time`)
) ENGINE=InnoDB CHARSET utf8;
CREATE TABLE `users_geodistribution` (
`Code` varchar(2) NOT NULL,
`Users` int(10) NOT NULL
) ENGINE=InnoDB CHARSET utf8;
CREATE TABLE `users_history_emails` (
`UserID` int(10) NOT NULL,
`Email` varchar(255) DEFAULT NULL,
`Time` datetime DEFAULT NULL,
`IP` varchar(15) DEFAULT NULL,
KEY `UserID` (`UserID`)
) ENGINE=InnoDB CHARSET utf8;
CREATE TABLE `users_main` (
`ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`Username` varchar(20) NOT NULL,
`Email` varchar(255) NOT NULL,
`PassHash` varchar(60) NOT NULL,
`Secret` char(32) NOT NULL,
`IRCKey` char(32) DEFAULT NULL,
`LastLogin` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`LastAccess` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`IP` varchar(15) NOT NULL DEFAULT '0.0.0.0',
`Class` tinyint(2) NOT NULL DEFAULT '5',
`Uploaded` bigint(20) unsigned NOT NULL DEFAULT '0',
`Downloaded` bigint(20) unsigned NOT NULL DEFAULT '0',
`BonusPoints` float(20, 5) NOT NULL DEFAULT '0',
`Title` text NOT NULL,
`Enabled` enum('0','1','2') NOT NULL DEFAULT '0',
`Paranoia` text,
`Visible` enum('1','0') NOT NULL DEFAULT '1',
`Invites` int(10) unsigned NOT NULL DEFAULT '0',
`PermissionID` int(10) unsigned NOT NULL,
`CustomPermissions` text,
`can_leech` tinyint(4) NOT NULL DEFAULT '1',
`torrent_pass` char(32) NOT NULL,
`RequiredRatio` double(10,8) NOT NULL DEFAULT '0.00000000',
`RequiredRatioWork` double(10,8) NOT NULL DEFAULT '0.00000000',
`ipcc` varchar(2) NOT NULL DEFAULT '',
`FLTokens` int(10) NOT NULL DEFAULT '0',
`FLT_Given` int(10) NOT NULL DEFAULT '0',
`Invites_Given` int(10) NOT NULL DEFAULT '0',
`2FA_Key` VARCHAR(16),
`Recovery` text,
PRIMARY KEY (`ID`),
UNIQUE KEY `Username` (`Username`),
KEY `Email` (`Email`),
KEY `PassHash` (`PassHash`),
KEY `LastAccess` (`LastAccess`),
KEY `IP` (`IP`),
KEY `Class` (`Class`),
KEY `Uploaded` (`Uploaded`),
KEY `Downloaded` (`Downloaded`),
KEY `Enabled` (`Enabled`),
KEY `Invites` (`Invites`),
KEY `torrent_pass` (`torrent_pass`),
KEY `RequiredRatio` (`RequiredRatio`),
KEY `cc_index` (`ipcc`),
KEY `PermissionID` (`PermissionID`)
) ENGINE=InnoDB CHARSET utf8;
CREATE TABLE `xbt_client_whitelist` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`peer_id` varchar(20) DEFAULT NULL,
`vstring` varchar(200) DEFAULT '',
PRIMARY KEY (`id`),
UNIQUE KEY `peer_id` (`peer_id`)
) ENGINE=InnoDB CHARSET utf8;
CREATE TABLE `xbt_files_users` (
`uid` int(11) NOT NULL,
`active` tinyint(1) NOT NULL DEFAULT '1',
`announced` int(11) NOT NULL DEFAULT '0',
`completed` tinyint(1) NOT NULL DEFAULT '0',
`downloaded` bigint(20) NOT NULL DEFAULT '0',
`remaining` bigint(20) NOT NULL DEFAULT '0',
`uploaded` bigint(20) NOT NULL DEFAULT '0',
`upspeed` int(10) unsigned NOT NULL DEFAULT '0',
`downspeed` int(10) unsigned NOT NULL DEFAULT '0',
`corrupt` bigint(20) NOT NULL DEFAULT '0',
`timespent` int(10) unsigned NOT NULL DEFAULT '0',
`useragent` varchar(51) NOT NULL DEFAULT '',
`connectable` tinyint(4) NOT NULL DEFAULT '1',
`peer_id` binary(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
`fid` int(11) NOT NULL,
`mtime` int(11) NOT NULL DEFAULT '0',
`ip` varchar(15) NOT NULL DEFAULT '',
PRIMARY KEY (`peer_id`,`fid`,`uid`),
KEY `remaining_idx` (`remaining`),
KEY `fid_idx` (`fid`),
KEY `mtime_idx` (`mtime`),
KEY `uid_active` (`uid`,`active`)
) ENGINE=InnoDB CHARSET utf8;
CREATE TABLE `xbt_snatched` (
`uid` int(11) NOT NULL DEFAULT '0',
`tstamp` int(11) NOT NULL,
`fid` int(11) NOT NULL,
`IP` varchar(15) NOT NULL,
`seedtime` int(11) NOT NULL DEFAULT '0',
KEY `fid` (`fid`),
KEY `tstamp` (`tstamp`),
KEY `uid_tstamp` (`uid`,`tstamp`)
) ENGINE=InnoDB CHARSET utf8;
SET FOREIGN_KEY_CHECKS = 1;