Files
ops-Ocelot/gazelle.sql

176 lines
6.2 KiB
SQL

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;