CREATE TABLE `categories` (
  `catid` int(255) NOT NULL default '0',
  `catname` varchar(255) NOT NULL default '',
  `subid` int(255) NOT NULL auto_increment,
  `subname` varchar(255) NOT NULL default '',
  `torrents` int(11) NOT NULL default '0',
  UNIQUE KEY `subid` (`subid`),
  KEY `catid` (`catid`)
) TYPE=MyISAM AUTO_INCREMENT=126 ;


INSERT INTO `categories` VALUES (1, 'Movies', 1, 'Action', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 2, 'Drama', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 3, 'DVD / Film extra''s', 0);
INSERT INTO `categories` VALUES (2, 'Series', 4, '24', 0);
INSERT INTO `categories` VALUES (2, 'Series', 5, 'Buffy', 0);
INSERT INTO `categories` VALUES (2, 'Series', 6, 'Charmed', 0);
INSERT INTO `categories` VALUES (2, 'Series', 7, 'Misc', 0);
INSERT INTO `categories` VALUES (3, 'Music', 8, 'Alternative', 0);
INSERT INTO `categories` VALUES (3, 'Music', 9, 'Rap/Hiphop', 0);
INSERT INTO `categories` VALUES (3, 'Music', 10, 'Pop', 0);
INSERT INTO `categories` VALUES (3, 'Music', 11, 'Misc', 0);
INSERT INTO `categories` VALUES (4, 'Games', 12, 'Pc Games', 0);
INSERT INTO `categories` VALUES (4, 'Games', 13, 'Ps2', 0);
INSERT INTO `categories` VALUES (4, 'Games', 14, 'Xbox', 0);
INSERT INTO `categories` VALUES (4, 'Games', 16, 'Gamecube', 0);
INSERT INTO `categories` VALUES (5, 'Software', 17, 'Windows', 0);
INSERT INTO `categories` VALUES (5, 'Software', 18, 'Linux', 0);
INSERT INTO `categories` VALUES (6, 'Anime', 19, 'Misc', 0);
INSERT INTO `categories` VALUES (7, 'Misc', 20, 'Pictures', 0);
INSERT INTO `categories` VALUES (7, 'Misc', 21, 'Others', 0);
INSERT INTO `categories` VALUES (7, 'Misc', 22, 'Audio books', 0);
INSERT INTO `categories` VALUES (7, 'Misc', 24, 'Ebooks', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 25, 'Adventure', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 26, 'Animation', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 27, 'Asian', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 28, 'Comedy', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 29, 'Concerts', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 30, 'Documentary', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 31, 'Family', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 32, 'Fantasy', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 33, 'Horror', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 34, 'Misc', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 35, 'Romance', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 36, 'Thriller', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 37, 'Sci-Fi', 0);
INSERT INTO `categories` VALUES (4, 'Games', 38, 'Dreamcast', 0);
INSERT INTO `categories` VALUES (4, 'Games', 39, 'Game fixes/patches', 0);
INSERT INTO `categories` VALUES (4, 'Games', 40, 'Mac', 0);
INSERT INTO `categories` VALUES (4, 'Games', 41, 'PS X', 0);
INSERT INTO `categories` VALUES (4, 'Games', 42, 'PSP', 0);
INSERT INTO `categories` VALUES (4, 'Games', 43, 'Roms', 0);
INSERT INTO `categories` VALUES (5, 'Software', 44, 'Mac', 0);
INSERT INTO `categories` VALUES (3, 'Music', 45, 'Blues', 0);
INSERT INTO `categories` VALUES (3, 'Music', 46, 'Classic', 0);
INSERT INTO `categories` VALUES (3, 'Music', 47, 'Country / Western', 0);
INSERT INTO `categories` VALUES (3, 'Music', 48, 'Drum N Bass', 0);
INSERT INTO `categories` VALUES (3, 'Music', 49, 'Electronic', 0);
INSERT INTO `categories` VALUES (3, 'Music', 50, 'Soundtrack', 0);
INSERT INTO `categories` VALUES (3, 'Music', 51, 'Hardcore', 0);
INSERT INTO `categories` VALUES (3, 'Music', 52, 'Metal', 0);
INSERT INTO `categories` VALUES (3, 'Music', 53, 'Trance', 0);
INSERT INTO `categories` VALUES (3, 'Music', 54, 'Rock', 0);
INSERT INTO `categories` VALUES (3, 'Music', 55, 'Punk', 0);
INSERT INTO `categories` VALUES (3, 'Music', 56, 'R&B', 0);
INSERT INTO `categories` VALUES (4, 'Games', 92, 'Misc', 0);
INSERT INTO `categories` VALUES (2, 'Series', 58, 'Alias', 0);
INSERT INTO `categories` VALUES (2, 'Series', 59, 'CSI', 0);
INSERT INTO `categories` VALUES (2, 'Series', 60, 'Friends', 0);
INSERT INTO `categories` VALUES (2, 'Series', 61, 'Joey', 0);
INSERT INTO `categories` VALUES (2, 'Series', 62, 'Las Vegas', 0);
INSERT INTO `categories` VALUES (2, 'Series', 63, 'Lost', 0);
INSERT INTO `categories` VALUES (2, 'Series', 64, 'Scrubs', 0);
INSERT INTO `categories` VALUES (2, 'Series', 65, 'Smallville', 0);
INSERT INTO `categories` VALUES (2, 'Series', 66, 'Star-Trek Enterprise', 0);
INSERT INTO `categories` VALUES (2, 'Series', 67, 'Star-Trek The Next Generation', 0);
INSERT INTO `categories` VALUES (2, 'Series', 68, 'Stargate Atlantis', 0);
INSERT INTO `categories` VALUES (2, 'Series', 69, 'StarGate SG1', 0);
INSERT INTO `categories` VALUES (2, 'Series', 70, 'That 70s Show', 0);
INSERT INTO `categories` VALUES (2, 'Series', 71, 'The O.C.', 0);
INSERT INTO `categories` VALUES (3, 'Music', 86, 'Etnic - Non English', 0);
INSERT INTO `categories` VALUES (6, 'Anime', 73, 'Hentai', 0);
INSERT INTO `categories` VALUES (6, 'Anime', 74, 'Cartoons', 5);
INSERT INTO `categories` VALUES (1, 'Movies', 76, 'Kids', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 77, 'Mystery', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 78, 'Samples/Trailers', 0);
INSERT INTO `categories` VALUES (1, 'Movies', 79, 'Sports Related', 0);
INSERT INTO `categories` VALUES (2, 'Series', 81, 'Carnivale', 0);
INSERT INTO `categories` VALUES (2, 'Series', 82, 'Discovery Channel', 0);
INSERT INTO `categories` VALUES (2, 'Series', 84, 'The Daily Show', 0);
INSERT INTO `categories` VALUES (2, 'Series', 85, 'The Simpsons', 0);
INSERT INTO `categories` VALUES (3, 'Music', 87, 'Religious', 0);
INSERT INTO `categories` VALUES (3, 'Music', 88, 'Industrial', 0);
INSERT INTO `categories` VALUES (3, 'Music', 89, 'Jazz', 0);
INSERT INTO `categories` VALUES (3, 'Music', 90, 'Reggae', 0);
INSERT INTO `categories` VALUES (3, 'Music', 91, 'Videoclips', 0);
INSERT INTO `categories` VALUES (5, 'Software', 93, 'Other operating systems', 0);
INSERT INTO `categories` VALUES (5, 'Software', 94, 'Palm, PocketPC & IPAQ', 0);
INSERT INTO `categories` VALUES (2, 'Series', 95, '8 simple rules', 0);
INSERT INTO `categories` VALUES (2, 'Series', 96, 'American Idol', 0);
INSERT INTO `categories` VALUES (2, 'Series', 97, 'Battlestar Galactica', 0);
INSERT INTO `categories` VALUES (2, 'Series', 98, 'Boston Public', 0);
INSERT INTO `categories` VALUES (2, 'Series', 99, 'Dark Angel', 0);
INSERT INTO `categories` VALUES (2, 'Series', 100, 'Desperate Houswives', 0);
INSERT INTO `categories` VALUES (2, 'Series', 101, 'Duckman', 0);
INSERT INTO `categories` VALUES (2, 'Series', 102, 'Freaks and Geeks', 0);
INSERT INTO `categories` VALUES (2, 'Series', 103, 'God the devil and bob', 0);
INSERT INTO `categories` VALUES (2, 'Series', 104, 'Joan of Arcadia', 0);
INSERT INTO `categories` VALUES (2, 'Series', 105, 'Mythbusters', 0);
INSERT INTO `categories` VALUES (7, 'Misc', 122, 'Unsorted', 0);
INSERT INTO `categories` VALUES (7, 'Misc', 123, 'Crawled', 0);
INSERT INTO `categories` VALUES (4, 'Games', 124, 'Xbox 360', 0);
INSERT INTO `categories` VALUES (4, 'Games', 125, 'PS 3', 0);


CREATE TABLE `torrents` (
  `id` int(255) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `added` datetime NOT NULL default '0000-00-00 00:00:00',
  `updated` datetime NOT NULL default '0000-00-00 00:00:00',
  `size` bigint(255) NOT NULL default '0',
  `seeds` int(255) NOT NULL default '0',
  `peers` int(255) NOT NULL default '0',
  `registration` enum('0','1') NOT NULL default '0',
  `hash` varchar(40) NOT NULL default '',
  `tracker` varchar(255) NOT NULL default '',
  `maincat` int(11) NOT NULL default '0',
  `subcat` int(11) NOT NULL default '0',
  KEY `id` (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;